Control / history · All operations
Undo and restore
Undo, redo, snapshot, freeze, replay a recorded path.
Status
- In arcform
A feature, not a step
It lives in how a Protocol runs. src/history.rs in arcform at fc62d6f
- Shape of the result
- not a data operation
- Level
- not a step
Variants
Freeze or copy a snapshot
Keep a static copy of a sheet or column, with computed cells evaluated to plain values.
Undo or redo a change
Step back through recent changes, or forward again.
What other tools call it
Meridian's classification; an independent blind rating agreed on 86.2% of 312 rows (exact class, version 2).
VisiData (7)
dup-rowsread 2026-09-23Open duplicate sheet holding references to all rows, keeping the selection
dup-rows-deepread 2026-09-23Open duplicate sheet holding deep copies of all rows
freeze-colread 2026-09-23Add a frozen copy of current column with all cells evaluated
freeze-sheetread 2026-09-23Open a static copy of the sheet with every visible cell evaluated to a plain value
redo-lastread 2026-09-23Redo the most recent undo
setcol-freezeread 2026-09-23Replace current column with a frozen copy with all cells evaluated
undo-lastread 2026-09-23Undo the most recent change on current sheet
Background
Undo erases the last change done to a document, reverting it to an older state.[1] The redo command reverses an undo.[1] With undo, users can explore and work without fear of making mistakes, because mistakes can easily be undone.[1] In OpenRefine, any activity that changes the data can be undone, and changes are tracked from when a project is first created.[2]
When to use it
Some actions are not stored in the undo list and so cannot be undone: saving a file is not undoable, and scrolling or selection is usually not stored.[1] The number of previous actions that can be undone varies by program, version, and hardware or software capabilities.[1] Making a new edit usually clears the redo list.[1] In OpenRefine, if you move back one or more states and then perform a new operation, the later actions are erased and cannot be re-applied.[2] Before trying a new step from an earlier state, make sure you will not want the later steps again, or keep a copy of them first. (Meridian's view)
In VisiData, U undoes the most recent modification and R redoes the most recent undo, both requiring options.undo to be enabled.[3] In VisiData, undoing a search does not clear the highlighting of its matches; the highlight-clear command does that.[3] In VisiData, commands whose names begin with commit, open-file or reload-sheet are not undoable.[4]
In VisiData, the rows of a duplicated sheet, other than a deep copy, are references to rows on the source sheet, so edits to them are reflected in the original rows.[3] In VisiData, g' opens a frozen copy of the current sheet with all visible columns evaluated, which freezes the sheet's contents in a deliberate copy.[3] When a copy is meant to keep the data as it stood, make it a deliberate frozen copy rather than a duplicate whose rows are shared with the source. (Meridian's view)
In VisiData, the commands of a session are kept in a CommandLog, or cmdlog, which can be saved and replayed on the command line with vd -p.[5][3] A VisiData cmdlog records the exact filename and sheet names from the original session, so reusing it on a different input file means making it filename-independent first.[5] The change history of each OpenRefine project is saved with the project's data, so quitting OpenRefine does not erase the steps taken.[2]
The method
Undo can be implemented through different patterns, the most common being the command pattern and the memento pattern.[1] The command pattern is a software design pattern that stores every action in a command object, with an execute operation and, for undo, an unexecute operation that undoes its effect.[1] In the memento pattern, the internal state of an object is stored in a memento, and the undo mechanism keeps the mementos safe but never changes their contents.[1]
Linear undo is implemented with a stack, a last in first out data structure storing a history of all executed commands, so only the last executed command can be undone.[1] Non-linear undo lets the user undo executed commands in an arbitrary order, choosing a command from the list rather than only the most recent one.[1]
A full checkpoint saves the complete state after each command, which is the easiest implementation but is not highly efficient and so not often used.[1] A complete rerun saves the initial state and reaches any state in the history by starting from it and redoing all commands from the beginning.[1] A partial checkpoint, the most used strategy, saves the changed part of the application state and sets that part back on undo.[1]
OpenRefine shows a project's history as a list of changes in order, the first being the creation of the project itself, which cannot be undone.[2] In OpenRefine, clicking an earlier action in the history undoes the changes after it, and clicking a greyed-out change redoes everything up to and including it.[2] OpenRefine can extract a project's operations up to the current state as JSON and apply them to another project, though edits to a single cell cannot be extracted.[2] In VisiData, redo replays the most recently undone command from the sheet's list of undone commands.[4]
The File Retrieval and Editing System, developed starting in 1968 at Brown University, is reported to be the first computer-based system to have had an undo feature.[1] Multi-level undo commands were introduced in the 1980s, allowing users to take back a series of actions, not just the most recent one.[1]
Compared with the alternatives
In database technologies, a rollback is an operation which returns the database to some previous state.[6] In Structured Query Language (SQL), ROLLBACK discards all data changes since the last START TRANSACTION or BEGIN, so the data is as it was before those changes were made.[6] Reach for undo when exploring a table step by step, and for a transaction when a batch of changes must land whole or not at all. (Meridian's view)
Sources
- [1]Undo - Wikipediasecondary source
- [2]Running OpenRefine | OpenRefinedocumentation
- [3]Quick Reference Guide | Docs | VisiDatadocumentation
- [4]visidata/visidata/undo.py at 7609212ec2febafa9caba7183cbebfaf49627909 · saulpw/visidatadocumentation
- [5]Save and Restore | Docs | VisiDatadocumentation
- [6]Rollback (data management) - Wikipediasecondary source