Undo and redo
Edit → Undo takes back the last change to the database, and Edit → Redo makes it again. The keys are ⌘Z and ⇧⌘Z on macOS, and Ctrl+Z and Ctrl+Shift+Z or Ctrl+Y elsewhere. In the REPL, enter :undo and :redo.
Each step says what it did, such as “Undid the last database change (12 rows).”
- Every tab of a database shares one history, so Undo takes back the newest change from any of them.
- In a text field, a formula, the REPL, or a dialog, the keys edit the text. Use the menu there to undo database changes.
- A
varor a property written with#[untracked]stays out of the history, as a selection, a layout’s positions, or a simulation’s state should: changing only untracked data takes no undo step, and Undo and Redo never change it, except that they clear refs to what they remove and the untracked Values of a member they remove. Files and copies still hold it. - Undo stops at a change to declarations, such as a new
def, and at a change too large to keep. - Each database keeps its last 1,000 changes, within 64 MiB. A new change clears what Redo could make again.
- The history starts empty when a database is created, opened from a file, copied, or reset with
:reset. Renaming, exporting, and deleting are not changes in it, and exported files do not keep it.
Debug → Undo History shows the history and steps through it.