Undo

In some more advanced programs, such as graphic processing, undo will negate the last command done to the file being edited.

With the possibility of undo, users can explore and work without fear of making mistakes, because they can easily be undone.

The expectations for undo are easy to understand: to have a predictable functionality, and to include all "undoable" commands.

The redo command reverses the undo or advances the buffer to a more recent state.

[5][6] Warren Teitelman developed a Programmer's Assistant as part of BBN-LISP with an Undo function, by 1971.

[8] A 1976 research report by Lance A. Miller and John C. Thomas of IBM, Behavioral Issues in the Use of Interactive Systems,[9] noted that "it would be quite useful to permit users to 'take back' at least the immediately preceding command (by issuing some special 'undo' command).

"[10] The programmers at the Xerox PARC research center assigned the keyboard shortcut Ctrl-Z to the undo command, which became a crucial feature of text editors and word processors in the personal computer era.

There, he and Bill Atkinson advocated for the presence of an undo command as a standard fixture on the Apple Lisa.

[citation needed] When Apple introduced the Lisa's successor, the Macintosh, it stipulated that all standard applications should include an “Undo” as the first command in the “Edit” menu,[12] which has remained the standard on macOS and Windows to this day.

Multi-level undo commands were introduced in the 1980s, allowing the users to take back a series of actions, not just the most recent one.

[1] Some common properties of models are: Linear undo is implemented with a stack (last in first out (LIFO) data structure) that stores a history of all executed commands.

The history list of the executed commands are interpreted "as a script, the effect of an undo is defined to be the same as if the undone action had never occurred in the first place.

A disadvantage of this model is that the user has to know the connection between undone command and the current state to avoid side effects.

[1] Even though the set of commands is simple and easy to understand, the complex structure with skipping and linking branches is hard to comprehend and to remember, when the user wants to undo more than one step.

On the other hand, rotation can be used "to select the place in the redo list where the next undo operation will put the command".

The third function for selective undo is that "no command can be automatically discarded from history buffer without direct user’s request.

The second issue that modified commands can be undone and so it has to be solved which state after undo will be presented.

The operation creates a copy of the selected command, executes this and add it to the history list.

Global multi-user undo reverts the latest action made to the document, regardless of who performed the edit.

Where undo can be used to backtrack through multiple edits, the redo command goes forward through the action history.

The number of previous actions that can be undone varies by program, version, and hardware or software capabilities.

Undo and redo are implemented so that the list is run through forwards and backwards when the execute or unexecute command is called.

[14] The most part of undo mechanism can implemented without dependency to specific applications or command classes.