Search the User Guide

Windows · Linux · Mac

`Ctrl` + `Z` `⌘`  `Z` undoes the last change and `Ctrl` + `Y` `⇧`  `⌘`  `Z` does it again. Typing is undone a few words at a time; an operation of the Table, Rows, Columns or Cells menu, however many cells it changed, is undone in one step; so is a **replace all**.

Each tab has its own history, and undoing back to the text you last saved makes the tab clean again: the dot of unsaved changes goes away.

## After a reload

The history is kept with the tabs you leave open, so it survives a reload of the page, closing the browser or, in the desktop app, quitting it: open the editor again and `Ctrl` + `Z` `⌘`  `Z` goes on from where you were. Undoing back to what is saved makes the tab clean then too.

Very long histories are trimmed from the oldest end: each tab keeps its most recent changes, up to about 50 million characters of them.

See [Tabs, and the work you leave open](/content/help/files/tabs-and-sessions/index.html) for what else is kept.

## After closing the file

Close a tab and open its file again later, and `Ctrl` + `Z` `⌘`  `Z` still goes on from where you were. If you closed it with **Don’t Save**, the file opens as you last saved it, and `Ctrl` + `Y` `⇧`  `⌘`  `Z` brings back the changes you didn’t save.

This works for files that are on your computer with a tab of their own: in the desktop app, and in a browser that opens files directly (Chrome or Edge). Not for a new file that was never saved, nor for a copy imported from Excel or JSON. If the file was changed by another program in the meantime, the history no longer fits it: the file opens with a new one.

The histories of the 50 files closed most recently are kept, for 30 days, up to about 200 million characters in all.

## Clearing the history

What you delete stays in the undo history, so Edit › Clear Undo History… clears it: from the active tab (`Ctrl` + `Z` `⌘`  `Z` then has nothing to undo), or also from every file you closed. Clearing it can’t be undone. See [Privacy and storage](/content/help/reference/privacy-and-storage/index.html).
