Undo
Letting people reverse what they just did, which makes interfaces safe to explore and usually beats asking "are you sure?" before every action.
Undo lets people reverse their most recent actions. It is one of the most valuable features an interface can offer, because it changes how people behave: when mistakes are cheap to reverse, people explore, try things and learn by doing. Nielsen's list for heuristic evaluation names it under "user control and freedom".
The Bravo editor at Xerox PARC had an undo command in the mid-1970s, and the original Macintosh made single-level undo a standard command. Multi-level undo became expected as memory grew cheaper.
Undo versus confirmation. The common alternative is a confirmation dialog: "Are you sure you want to delete this?" Confirmations work poorly. People see them so often that clicking "OK" becomes automatic, a form of habituation, and the dialog stops protecting anything. Each one also interrupts, as any Modal Dialog does. Undo protects without interrupting: the action happens immediately, and a brief notice offers to reverse it. Email "undo send" works by simply delaying the send for a few seconds. Deletion is often a Soft Delete under the hood, so the item can come back.
Some actions can't be undone: a sent payment, a published message others have read, a dropped database. For those, a deliberate obstacle is appropriate, such as typing the project's name to confirm deletion. The friction is worth it when the action is both rare and irreversible.
Implementation approaches:
- Command pattern. Each action is recorded as an object that knows how to reverse itself, and undo pops the last one off a stack. Redo keeps a second stack, usually cleared when a new action is taken.
- Snapshots. Save the whole state before each action. With Immutability and a Persistent Data Structure, snapshots share most of their memory and become cheap.
- Event logs. In Event Sourcing, state is rebuilt from a list of events, so undo means appending a compensating event.
Linear undo discards the redo history when you make a new edit after undoing. Some editors keep an undo tree instead, so every past state remains reachable. The idea parallels Version Control, which is undo for whole projects.
Collaboration makes undo harder. If two people edit a document at once, "undo" should reverse my last change, not theirs, even if theirs came later and depends on mine. Collaborative editors built on a Conflict-Free Replicated Data Type must define undo carefully so each person's history stays coherent.
Undo also pairs naturally with Optimistic UI: show the result immediately and roll it back if the server rejects it. In editing surfaces such as contenteditable, the browser keeps a native undo stack that custom editing logic easily breaks. Systems apply the same principle at larger scale, with deployments built for Rollback and data protected by Backup and Restore.
See also3
Reflog
Git's private record of everywhere HEAD and each branch has pointed, the safety net that makes a botched reset, rebase, or deleted branch recoverable for weeks.
Version Control & Delivery13 connections
Direct Manipulation
Ben Shneiderman's 1983 name for interfaces where people act on visible objects with immediate, reversible feedback, such as dragging a file or resizing a shape, instead of typing commands that describe the change.
Design & Interface14 connections
Error Message
Writing and placing the messages that tell people something went wrong, so they understand what happened and how to recover without feeling blamed.
Design & Interface13 connections
Linked from10
- ClipboardSystems & Tooling
The shared buffer behind cut, copy, and paste, invented at Xerox PARC, which offers data in several formats at once and has become a channel for snooping and for commands that paste differently from how they looked.
- contenteditableWeb Platform
The HTML attribute that makes an element directly editable, and the surface behind most rich-text editors.
- Direct ManipulationDesign & Interface
Ben Shneiderman's 1983 name for interfaces where people act on visible objects with immediate, reversible feedback, such as dragging a file or resizing a shape, instead of typing commands that describe the change.
- Error MessageDesign & Interface
Writing and placing the messages that tell people something went wrong, so they understand what happened and how to recover without feeling blamed.
- Modal DialogDesign & Interface
A window that blocks the rest of the interface until it is dealt with, useful for decisions that truly demand attention and overused for almost everything else.
- Persistent Data StructureComputation & Algorithms
Data structures that preserve every previous version when changed, sharing unchanged parts between versions so "copying" is cheap.
- ReflogVersion Control & Delivery
Git's private record of everywhere HEAD and each branch has pointed, the safety net that makes a botched reset, rebase, or deleted branch recoverable for weeks.
- Toast NotificationDesign & Interface
A brief, non-blocking message that slides in to confirm an action or report a background event, then disappears on its own.
- Toggle SwitchDesign & Interface
An on-screen control for a single on-or-off setting that takes effect immediately, borrowed from light switches, distinct from checkboxes and radio buttons, and notorious for leaving people unsure which state it is in.
- WizardDesign & Interface
An interface that guides a person through a complex task as a sequence of simple steps with Next and Back buttons, ideal for rare, unfamiliar tasks like installing software or filing taxes, and frustrating when imposed on experts doing something routine.