Undo (the arrow at the top, or Ctrl+Z) cancels your last changes. Each page keeps its own undo history until you leave or reload the editor. Changes to the theme, header or footer can only be undone while you stay on the same page.
Each time you save a page, a version is kept. In the Versions tab, under Page, click a version to load it in the editor. Nothing changes online until you save and publish it. Changed your mind? Click Undo.
Page versions only hold the page's sections. The header and footer have no versions and go online as soon as you save: check them before saving.
The theme keeps a version each time it is published. In Versions, under Theme, Restore puts that version back as your theme draft; publish it to put it online.