Saving and undoing in the layout editor
Undo survives a Save but not a reload. Since 0.25.0, a save that would overwrite a newer save asks you first.
Saving is explicit — nothing autosaves in the layout editor, on the admin Layout tab or on Design on site. Undo, meanwhile, is ordinary in-memory history: a stack of states the editor keeps for as long as it's open, and nothing more durable than that.
What undo remembers, and what it doesn't
Undo has no idea a save happened — saving updates what the editor treats as the "original" document without touching the history stack, so you can save, then undo back past that save, in the same session. What it can't do is survive the session itself: reload the page, or close the editor and reopen it, and the history is gone. You start again from one entry, the document as it now stands.
What clears the history on purpose
Two actions reset it deliberately. Cancel reverts to the last saved document and clears history along with it — and if you have unsaved edits, Cancel asks first rather than reverting on the spot. The other is an internal refresh of linked component copies, which only runs when the document is still pristine, so it never discards an edit you haven't saved.
Leaving with unsaved work prompts you either way: the front-of-site overlay warns before a browser reload or tab close, and the admin form asks before you switch away from the Layout tab with edits pending.