Fact-checked by Grok 2 weeks ago

Undo

Undo is an technique in computer interfaces that allows to reverse recent actions, thereby restoring the system or document to a previous and facilitating during human-computer . This feature, often invoked via keyboard shortcuts like Ctrl+Z (or on macOS) or menu options, is a standard component of most interactive applications, including text editors, programs, and , enabling to experiment freely without fear of irreversible mistakes. The undo mechanism typically maintains a of operations, treating each action as a reversible command that can be nullified to support both single-step reversal of the last action and multi-level undo for a sequence of prior changes. The concept of undo emerged in the early days of interactive computing, with foundational discussions appearing in the as early as , where it was proposed as a means for recovering from errors in graphical systems. By the late , database systems incorporated undo capabilities for reversal, as outlined in seminal work on recovery mechanisms. The feature gained prominence in the with the rise of graphical user interfaces; for instance, the original Apple Macintosh applications, such as released in 1984, included undo functionality from their inception, making it accessible to consumer users through simple menu commands and enabling of bitmapped graphics with easy reversal of drawing operations. Interactive undo for direct manipulation interfaces was further emphasized in human-computer interaction research during this period, highlighting its role in enhancing user confidence and productivity. In modern implementations, undo is commonly realized through a or stack-based history, where each action is recorded along with its inverse operation, allowing efficient reversal without re-executing the entire session from scratch. Accompanying redo functionality permits reinstatement of undone actions, often using a parallel to maintain balance in the interaction history. While straightforward in single-user environments, undo in collaborative or distributed systems introduces complexities, such as handling concurrent edits and selective reversal of individual contributions to avoid disrupting shared states. Today, advanced variants include infinite undo in cloud-based tools and domain-specific adaptations, like regional undo in spreadsheets, underscoring the feature's evolution to meet diverse user needs across software ecosystems.

Fundamentals

Definition and Functionality

Undo is a fundamental interaction technique in computer software that enables users to revert the effects of a previous action or command, thereby restoring the application or system to an earlier state in its history. This mechanism supports error correction by allowing reversal of unintended changes, such as deletions or modifications, without requiring manual reconstruction of prior conditions. The primary functionality of undo involves maintaining a record of the system's evolution, either through a sequence of operations or discrete snapshots, to facilitate reversal upon user request. This history is typically managed via a stack data structure, where actions are pushed onto the stack sequentially, and undo pops the most recent entry to execute its inverse, subject to constraints like finite stack depth to manage memory usage or performance. For instance, exceeding the stack limit may discard older entries, preventing indefinite history retention. Undo implementations distinguish between state-based approaches, which store complete snapshots of the application state at key points for direct restoration, and operation-based (or command-based) approaches, which log individual commands along with their inverse functions to recompute prior states dynamically. State-based undo is straightforward for simple systems but can be resource-intensive for complex applications due to snapshot storage, while operation-based undo offers efficiency by avoiding full copies but requires careful command invertibility. A practical example illustrates this in a : when a deletes a , an -based undo records the deletion command and its (insertion of the original text at the exact position), enabling restoration of the deleted content upon invocation, thus seamlessly reversing the action. The , redo, reinstates undone changes, typically using a parallel to track reversals. Key benefits of undo include facilitating error recovery to mitigate mistakes, encouraging experimentation by lowering the cost of trial-and-error interactions, and building confidence in direct manipulation interfaces, which promotes explorative learning without fear of irreversible consequences.

User Interface Conventions

In user interface design for software applications, the undo function is typically invoked through standardized keyboard shortcuts to facilitate quick error correction. On Windows and Linux systems, the primary shortcut is Ctrl+Z, while macOS uses ; for redo, these are Ctrl+Y or Command+Shift+Z, respectively. These conventions, established by major operating system developers, ensure cross-application consistency and reduce the learning curve for users switching between programs. Undo options are commonly integrated into menus and toolbars for accessibility beyond keyboard use. In the Edit menu of most desktop applications, such as Microsoft Word or Google Docs, "Undo" appears as the first or second item, often accompanied by a curved left-pointing arrow icon representing reversal. Toolbars in creative software like Adobe Illustrator feature prominent undo buttons with this icon, allowing one-click reversal of the last action. Visual feedback enhances user awareness of undo capabilities and states. Dynamic labels, such as "Undo Typing" in text editors like Notepad++ or "Undo Paste" in browsers, display the specific action being reversed, providing contextual clarity. When no actions are available for undo—such as at the start of a session—the menu item or button is grayed out or disabled, preventing erroneous attempts and signaling the undo stack's empty state. For applications supporting multi-level undo, interfaces often include panels or lists to preview and select from a history of actions. In , the History panel lists recent states like "" or "Brush Tool," enabling users to jump to any prior state without sequential reversals. This approach, common in professional tools, balances efficiency with precision by visualizing the undo depth, with a default limit of 50 steps that is configurable based on available memory. Accessibility features extend undo functionality to diverse input methods, particularly in mobile and touch-based interfaces. On devices, a "shake to undo" detects device motion to trigger the function, with a confirmation dialog appearing to confirm the reversal, catering to users with motor impairments. Voice commands, such as "undo last action" via built-in assistants in or Windows apps, further support hands-free operation. Platform-specific variations influence how undo is presented and behaves. Desktop applications adhere closely to OS-level shortcuts and menus, whereas web browsers like treat browser history as an extended undo mechanism, allowing back-navigation via the left button or Alt+Left to revert page changes. In contrast, views may rely more on swipe for undo-like , diverging from norms to suit touch interactions.

Historical Evolution

Early Developments

The concept of undo emerged in the late 1960s as a response to the need for error recovery in interactive computing environments. One of the earliest implementations appeared in the File Retrieval and Editing System (FRESS), developed at starting in 1968, which pioneered a single-level undo for word processing and hypertext editing. Another early example was in BBN-LISP, a dialect developed at Bolt, Beranek and Newman, where Warren Teitelman introduced an UNDO function in 1971 as part of a Programmer's Assistant. This feature allowed users to reverse previous commands, initially as a simple single-step reversal, marking a pioneering step in providing reversibility for programming tasks. Motivations for such features stemmed from growing human-computer interaction research emphasizing the importance of error prevention and recovery. In the late 1970s, Ben Shneiderman's work highlighted the need for systems that offered immediate feedback and constructive guidance for correcting mistakes, rather than forcing users to restart tasks. His experiments demonstrated that prompt error detection and simple recovery mechanisms significantly improved user performance in interactive tasks, influencing the design of more forgiving interfaces. Undo was introduced in commercial software through PARC's innovations in graphical user interfaces. The computer system, developed in 1973, supported early graphical applications that incorporated basic undo capabilities for reversing actions in visual editing. This was notably adopted in the word processor, released in 1974, which included an Undo command to revert typing and formatting changes, representing one of the first instances in a environment. Early undo systems were constrained by hardware limitations, such as limited , which restricted implementations to single-level reversals rather than multi-step stacks. These features were often designed as simple toggles—reversing the last action upon a second invocation—due to memory costs of storing multiple states, a common challenge in where systems like the had only 96 of memory. A key milestone came with the in 1983, which introduced a dedicated undo mechanism integrated into its , allowing users to reverse the last change across applications and providing a foundational model that influenced the Macintosh system in 1984. This advancement built on prior work by emphasizing user experimentation without fear of irreversible errors. Later developments would evolve these concepts into more advanced models.

Integration into Modern Software

The integration of undo features into graphical user interfaces gained momentum in the early 1990s as operating systems standardized multi-level undo capabilities. Microsoft Windows 3.0, released in 1990, incorporated undo functionality in its core applications and shell, building on earlier single-action reversals to support more robust editing workflows that influenced subsequent software norms. Similarly, Apple , launched in 1991, introduced a multiple-level undo/redo at the operating system level through patent-pending technology, enabling applications to provide deeper reversal histories and setting a for consistent user expectations across the Macintosh . As shifted to the and platforms, undo adaptations extended to browser-based and touch interfaces. In the domain, iOS 3.0 in 2009 pioneered gesture-based undo via the "Shake to Undo" feature, allowing users to reverse text edits by shaking the device, which integrated seamlessly with the paradigm and influenced Android's subsequent implementations. Domain-specific software evolved undo to meet specialized needs, enhancing creative and development workflows. introduced its History panel in version 5.0 (1998), enabling users to configure extensive or effectively unlimited undo states for non-destructive editing, a feature that persists in modern iterations and supports processes. Integrated development environments like , from the early 2000s, incorporated versioned undo tied to source control systems such as Visual SourceSafe, allowing developers to revert changes across file versions rather than isolated actions. Recent advancements up to 2025 emphasize context-aware and scalable undo in AI-driven and cloud environments. In AI-assisted editors, Copilot's 2023 integrations in enable contextual reversals of AI-generated code suggestions, where users can undo targeted insertions while preserving surrounding edits, improving reliability in collaborative coding. Cloud-based tools, such as , leverage server-side storage for unlimited undo through version history, storing complete states indefinitely to support long-term revisions without local constraints. These developments reflect ongoing standardization, with Apple's (updated for and in 2023–2024) recommending intuitive undo patterns like swipe gestures and dialogs, and Google's 3 revisions (2021 onward, with 2023 component updates) promoting snackbar-based undo actions for transient operations like deletions.

Undo and Redo Models

Linear Undo Models

Linear undo models represent the foundational approach to implementing undo functionality in software applications, treating user actions as a strict sequential history that can only be traversed backward or forward in chronological . These models typically rely on two data structures: an undo to store completed actions in last-in, first-out (LIFO) and a redo to manage previously undone actions for potential reapplication. When a new is performed, it is pushed onto the undo after execution, and the redo is cleared to reflect the updated linear path. Performing an undo operation pops the most recent from the undo , applies its to revert the , and pushes that onto the redo ; conversely, a redo pops from the redo and reapplies the to the undo . This dual- ensures predictable navigation but enforces a single, unbranching timeline of changes. To address memory constraints, particularly in early environments, linear undo models often incorporated a fixed-depth limit on the undo due to resource limitations. For example, some applications limited undo to a small number of recent actions to balance history retention with system performance. By overwriting the earliest actions, these models prevent unbounded growth in storage requirements while still providing practical error recovery for recent operations. Central to the operation of linear undo models is the concept of command inversion, where each is encapsulated as a self-contained that includes both its forward execution and a corresponding to reverse its effects. For example, in a text context, a delete would store the removed content along with its precise original position and attributes; the undo then reapplies that content at the stored location to restore the prior state exactly. This pairing allows for reversible transformations without requiring the system to reconstruct states from scratch, ensuring atomicity and consistency in state transitions. The strengths of linear undo models lie in their conceptual simplicity and minimal overhead, which facilitate straightforward integration into user interfaces and reduce the complexity of in single-threaded applications. These attributes have contributed to their widespread adoption in conventional software tools. However, their limitations become evident in scenarios requiring flexibility, as the model prohibits branching histories or the targeted reversal of non-consecutive actions, potentially forcing users to navigate through irrelevant steps to reach desired corrections. A illustration of the core linear undo mechanism highlights its operational flow:
initialize undoStack as empty [stack](/page/Stack)
initialize redoStack as empty [stack](/page/Stack)

function performAction([action](/page/Action)):
    [action](/page/Action).execute()  // Apply the forward operation
    undoStack.push([action](/page/Action))
    redoStack.clear()  // Discard alternative futures

function undo():
    if not undoStack.isEmpty():
        [action](/page/Action) = undoStack.pop()
        [action](/page/Action).invert()  // Apply the [inverse](/page/Inverse) operation
        redoStack.push([action](/page/Action))

function redo():
    if not redoStack.isEmpty():
        action = redoStack.pop()
        action.execute()  // Reapply the forward operation
        undoStack.push(action)
In restricted implementations, the push operation on undoStack checks for capacity (e.g., if size exceeds a predefined limit, discard the bottom element before pushing). This design prioritizes recent actions while maintaining the LIFO principle for efficient access.

Non-Linear Undo Models

Non-linear undo models extend beyond sequential reversal by enabling users to navigate and reverse action histories in flexible, non-chronological ways, often through branching structures or dependency-aware representations that accommodate complex workflows such as exploratory or . These models contrast with linear stacks by modeling actions as interconnected elements, allowing undos that skip, branch, or selectively revert subsets without fully replaying the entire sequence. The model, introduced by Archer, Conway, and Schneider in 1984, represents user actions as executable within a , where each command is a node linked to prerequisites and effects. Undo is achieved by replaying inverse that remove or reverse the targeted action's effects while preserving dependencies, enabling non-linear navigation such as skipping intermediate steps in a sequence. This approach is particularly suited to applications with operations, like CAD software, where undoing a segment restores object states without disrupting unrelated branches. For instance, in , users can revert a specific while maintaining subsequent modifications to other elements. The model divides the history into three streams—user history for all actions, active for the current state, and pending for redo candidates—facilitating partial execution and what-if explorations. Building on similar principles, the US&R (Undo, Skip, & Redo) model, proposed by Vitter in 1984, separates undo and redo mechanisms through script-like structures that permit skipping commands during replay, creating branched histories in a . This allows partial execution of sequences, where skipped actions are marked but not deleted, supporting non-linear recovery in environments with interdependent operations, such as complex simulations or parameterized queries. Introduced in the context of interactive systems, US&R enables users to explore alternative paths by branching from a skip point, then merging or discarding them, which was particularly innovative for in handling reversible computations without linear commitment. For example, in a simulation tool, a user could skip a faulty adjustment during redo, branching to test variations while retaining the original history for fallback. The triadic model, described in the literature as of (, ), employs a three-way branching comprising past (undo ), present (active ), and future (redo list) histories, with merge capabilities to integrate exploratory back into the main timeline. This supports non-linear undo by allowing users to rotate or select from the redo list for what-if scenarios, such as temporarily branching to evaluate alternative outcomes before committing or discarding changes. Unlike purely linear systems, it treats the redo buffer as a circular, navigable , enabling undos that revert to any prior and that selectively advance along . Yang's framework was designed for general-purpose CAD systems, where designers could explore design variants—e.g., adjusting a component's position in a branch—without losing the primary history, thus fostering creative . Graph-based representations generalize these approaches by modeling actions as nodes in a , with edges denoting or causal relationships, allowing undo of entire subtrees or paths. This structure supports non-sequential reversals, such as a subtree to undo a cluster of related actions (e.g., all modifications to a single object in a ), while preserving independent branches. Seminal work in this area, as discussed by in , highlights how such resolve conflicts in selective undos by propagating inverses along dependency edges, making it applicable to object-oriented systems where state changes are interconnected. For instance, in graphical editors, undoing a subtree might revert multiple linked edits without affecting unrelated graph components. Despite their flexibility, non-linear undo models introduce significant limitations, including heightened for maintaining and traversing dependency graphs, which can lead to performance overhead in applications. In modern applications, these models have evolved to support larger histories, such as unlimited undo in cloud-based tools (as of ). Storage requirements also escalate, as branching histories demand retaining multiple state versions or inverse operations, potentially consuming substantial memory compared to the simplicity of linear stacks—Yang noted that triadic structures, while powerful, require careful to avoid in large histories. Additionally, user comprehension challenges arise from visualizing non-linear paths, increasing the risk of disorientation in intricate graphs.

Selective Undo Approaches

Selective undo approaches enable users to reverse specific, non-consecutive actions from an interaction history without necessarily undoing all subsequent operations, providing greater flexibility than linear models. These techniques are particularly valuable in complex editing environments where users may regret isolated decisions amid a sequence of productive changes. By allowing direct selection of individual actions or indirect grouping and filtering, selective undo addresses common user needs for precise recovery while maintaining the integrity of the overall workflow. In direct selective undo, users explicitly choose any past action from a visualized history, such as a list or , to reverse it while preserving later actions where possible. For instance, Illustrator's History panel displays a chronological list of states, enabling users to select and revert to a specific prior state, effectively undoing targeted changes without a full linear . This approach relies on command objects that encapsulate each action's effects, allowing the system to re-execute or adjust dependent operations as needed. Dependency resolution is crucial in selective undo to handle interdependencies between actions, such as when undoing an early affects the applicability of later ones. Systems automatically adjust subsequent actions—for example, in text editors, undoing an insertion may cause ripple effects that shift positions of deletions or modifications, requiring recomputation of offsets to avoid inconsistencies. Alternatively, user choices can be offered for conflicts, such as prompting whether to propagate the undo or isolate it. In painting applications like , the system skips undone operations in the script history and re-renders the , ensuring visual consistency without manual intervention. Indirect selective undo methods provide alternatives by grouping or categorizing actions for batch reversal, reducing the need for granular selection. Users can group related actions into macros, treating them as a single unit for undo; for example, a sequence of in a drawing tool can be bundled and reverted collectively. Filtering by type offers another layer, allowing reversal of all actions of a certain category, such as undoing all formatting changes in a document while retaining content edits. In geographic information systems like , users can filter the undo stack to target only editing operations, isolating them from other interface actions for selective reversal. Research foundations for selective undo emerged in the early 1990s within human-computer interaction studies, building on command-based architectures to support non-linear recovery. A seminal contribution is Thomas Berlage's framework, which uses command objects to enable undoing isolated actions by assessing their applicability in the current state, thus resolving dependencies semantically rather than chronologically. This work influenced subsequent implementations, emphasizing generic mechanisms for consistent undo across graphical interfaces. Modern examples, such as timeline-based scrubbing in video editors like , extend these ideas by allowing users to navigate and revert to specific temporal points in the edit history.

Undo in Multi-User Environments

Challenges in Collaborative Editing

In collaborative editing environments, concurrency issues arise when multiple users perform simultaneous edits, leading to conflicts where one user's undo operation may inadvertently reverse or interfere with another's independent changes. For instance, in systems like , a user attempting to undo their own recent insertion might transform or override concurrent modifications by peers, resulting in unexpected document states. This stems from the need to maintain per-user undo histories while synchronizing shared content, a challenge exacerbated by (OT) algorithms that adjust operations for consistency but complicate selective reversals. Causality violations occur when an undo disrupts the intended sequence of interdependent actions across users, potentially breaking dependencies and causing lost work or inconsistencies. In shared histories, undoing an early operation (e.g., a foundational edit upon which later collaborative changes rely) can cascade into invalidating subsequent contributions, fostering scenarios akin to "undo wars" where users repeatedly reverse each other's efforts to restore . Such violations are particularly pronounced in systems, where the non-linear nature of multi-user interactions deviates from the linear assumed in single-user undo models. Scalability problems emerge in merging distributed undo stacks across networks, where in cloud-based applications amplifies delays and increases computational overhead for transforming large histories. As user counts grow, maintaining individual undo buffers while propagating changes globally leads to in , straining resources in tools supporting dozens of concurrent editors. Early collaborative tools like , released in 2008, highlighted these issues through OT-based implementations that struggled with "undo puzzles"—sequences of concurrent edits and reversals resulting in divergent states or lost contributions. Persistent challenges appear in wikis, where enables reversion but concurrent edits often trigger conflicts, requiring manual resolution to avoid fragmented histories despite advanced tracking. Psychological impacts include heightened user frustration from non-intuitive reversals, such as unexpected erasures of , which erodes in the system and hampers productivity in team settings.

Resolution Strategies

In collaborative editing environments, () serves as a foundational strategy for handling undo operations by transforming concurrent edits to preserve document consistency across users. Originally developed for groupware systems, interprets an undo command as a concurrent inverse operation, which is then transformed relative to other pending operations to ensure it applies correctly without disrupting the shared state. This approach was pivotal in tools like , introduced in the late 2000s, where undos are executed by inverting and transforming the relevant operations to synchronize all participants seamlessly. By maintaining causal ordering through transformation functions, mitigates conflicts arising from simultaneous edits, allowing selective undos that target specific user actions or operations. Conflict-free replicated data types (CRDTs) offer an alternative resolution strategy, enabling commutative operations that inherently support undo mechanisms in distributed systems without requiring centralized coordination. CRDTs ensure that all replicas converge to the same state regardless of operation order, facilitating undos through reversible, monotonically increasing data structures that track additions and removals separately. This commutativity allows inverse operations for undos to propagate across peers without transformation overhead, making it suitable for peer-to-peer collaborative applications. For instance, design tools like Figma, launched in the 2010s, incorporate CRDT-inspired structures to handle real-time undos during multiplayer sessions, ensuring edits from multiple designers merge conflict-free. Seminal work on CRDTs for text editing further extends this to selective undos, where users can revert specific insertions or deletions while preserving concurrent changes. Version branching addresses undo challenges by maintaining per-user branches of the edit history that diverge during local undos and merge upon synchronization, preventing one user's reversal from overwriting others' contributions. In this model, each collaborator operates on a personal linear history, with undos creating branch points that are reconciled using merge algorithms to resolve divergences. This strategy has been integrated into modern co-authoring features, such as version history in Microsoft Office, which allows users to restore prior document states to address changes from collaborative editing without disrupting ongoing work. By treating undos as branch creations rather than universal reversals, the approach scales to multi-user scenarios, though it requires efficient merging to avoid history bloat. Hybrid approaches combine elements of , CRDTs, and locking mechanisms, often employing server-side to manage undo permissions and resolve destructive conflicts in . In these systems, a central validates undo requests against the global state, applying transformations or commutativity checks while access to prevent cascading reversals that could erase valid edits. This ensures fairness, such as prioritizing the initiator's intent or queuing undos, and is particularly effective in heterogeneous environments where clients vary in . For example, models in collaborative editors use server-mediated merges to handle undo conflicts that OT alone cannot resolve commutatively.

Implementation Methods

Command Pattern

The , a behavioral pattern introduced in the seminal work on object-oriented design, encapsulates a request as an object, thereby allowing parameterization of clients with queues, requests, and operations, and supporting undoable commands through methods like execute(), undo(), and redo(). This approach treats individual actions—such as editing text or drawing shapes—as command objects that can be stored, executed, and reversed, facilitating the maintenance of a history list for undo and redo functionality in applications. In its structure, the pattern involves several key components: the Invoker, which initiates the command (often the user interface elements like menus or buttons); the , which is the target object that performs the actual operation on the application's state (e.g., a or ); and ConcreteCommand classes that implement specific actions, such as a PasteCommand for inserting text or a DrawLineCommand for . The Client creates ConcreteCommands and sets their Receiver, while the Invoker maintains a history of executed commands. Undo is realized by storing executed commands in a data structure, where invoking undo() on the top command reverses its effects, effectively restoring the prior state without full snapshots. For instance, in a text insertion operation, the undo() might swap the newly inserted characters with the previously stored selection or cursor position, ensuring precise inversion of changes. Redo() similarly re-executes popped commands from a separate . This pattern offers advantages such as decoupling the from , which promotes and testability; it also enables advanced features like macro recording (chaining commands) and transaction logging for auditing. It has been widely adopted in software , notably Qt's Undo Framework, which implements the pattern to provide robust undo/redo support in graphical applications since the early . A representative example in pseudocode illustrates a simple DrawLineCommand for a graphics editor:
interface Command {
    void execute();
    void undo();
    void redo();
}

class DrawLineCommand implements Command {
    private Canvas receiver;
    private Point start, end;
    private Color oldColor;  // Stored for inversion

    public DrawLineCommand(Canvas receiver, Point start, Point end) {
        this.receiver = receiver;
        this.start = start;
        this.end = end;
    }

    public void execute() {
        oldColor = receiver.getColorAt(start);  // Capture pre-execute state
        receiver.drawLine(start, end);
    }

    public void undo() {
        receiver.eraseLine(start, end);  // Or restore old state
        receiver.setColorAt(start, oldColor);
    }

    public void redo() {
        execute();
    }
}

// Usage in Invoker (e.g., UI handler)
Stack<Command> undoStack = new Stack<>();
Command cmd = new DrawLineCommand(canvas, p1, p2);
cmd.execute();
undoStack.push(cmd);
This hierarchy demonstrates how the ConcreteCommand handles state inversion internally, maintaining efficiency for repeated operations.

Memento Pattern

The is a behavioral that enables the capture and externalization of an object's internal state, allowing restoration to a previous state without violating encapsulation. Introduced in the seminal work Patterns: Elements of Reusable Object-Oriented Software by Gamma et al., it supports undo functionality by creating immutable snapshots of object states at key points, such as before user actions in applications like text editors or graphical tools. This approach ensures that the object's implementation details remain hidden from components managing the history. In the pattern's structure, three primary participants interact: the Originator, which holds the state to be saved and restored; the Memento, an opaque object that stores the Originator's state; and the Caretaker, responsible for maintaining a collection of Mementos, such as a stack for undo history. The Memento provides a narrow interface to the Caretaker—limited to operations like adding a snapshot or retrieving one for restoration—preventing access to sensitive internal data. Conversely, the Originator accesses a wide interface on the Memento, enabling it to fully serialize its current state into the snapshot or deserialize and apply a prior one. This separation preserves the Originator's encapsulation while allowing the Caretaker to manage state history externally. Undo operations leveraging follow a straightforward sequence: before executing a state-altering action, the Originator creates and passes a to the Caretaker for storage. On an undo request, the Caretaker supplies the most recent back to the Originator, which then restores its state accordingly, effectively rolling back changes. For instance, in text editors, this mechanism saves the document state—such as text content and formatting—enabling users to revert to previous versions without recomputing entire histories. The excels at managing complex, multifaceted states in a modular way, as the delegates history tracking to the without exposing internals, simplifying maintenance and enhancing reusability. It also integrates seamlessly with other undo strategies, such as operation-based methods detailed in the . However, drawbacks include substantial memory overhead from storing full , particularly in resource-intensive applications with deep undo histories or large objects. Optimizations mitigate these issues, such as using delta Mementos that capture only incremental changes between states rather than complete , significantly reducing storage needs for sequential operations. Compression techniques can further compact Memento data, especially for repetitive or sparse states. In practice, Java's undo toolkit exemplifies these principles through the StateEdit class, which employs Mementos via the StateEditable interface to snapshot and revert component states, supporting robust undo/redo in graphical user interfaces.

References

  1. [1]
    [PDF] Giving undo attention - Alan Dix
    Abstract. In this paper, we investigate the problems associated with the provision of an undo support facility in the context of a synchronous shared or ...
  2. [2]
    [PDF] A Framework for Undoing Actions in Collaborative Systems
    The ability to undo operations is a standard feature in most single-user interactive applications. In this paper, we propose a general framework for ...
  3. [3]
    [PDF] Regional Undo for Spreadsheets - UIST - ACM
    This paper describes a regional undo technique for spreadsheets that enables the user to fix an error by directly designating a region that contains the error. ...
  4. [4]
    [PDF] Reflections on Undo | Alan Dix
    Moreover, since the domain of interest of undo is an action or command history, when using undo the user is not simply interacting, but instead interacting ...
  5. [5]
    [PDF] A Generic Undo Support for State-Based CRDTs - DROPS
    state-based and operation-based. ... We use op for a normal operation and o for any operation, which can be either a normal operation or an undo operation.
  6. [6]
    [PDF] Operation-based versus State-based Merging in Asynchronous ...
    In this paper we present and compare two approaches for asynchronous communication in object-based collaborative graphical editing. The operations allowed ...
  7. [7]
    A selective undo mechanism for graphical user interfaces based on ...
    An undo facility enables explorative learning without fear, which is important in a world where new and im- proved software tools appear frequently. ACM ...
  8. [8]
    History of Interlisp
    UNDO is functionality that every user now expects in an editor, but it was first introduced in BBN-LISP in 1970. The UNDO functionality provided in BBN-LISP ...
  9. [9]
    [PDF] Human Factors Experiments in Designing Interactive Systems
    they apply their skills to interactive computer systems. Human Factors. Experiments in. Designing. Interactive Systems. Ben Shneiderman. University of Maryland.
  10. [10]
    Design case study: the bravo text editor - ACM Digital Library
    Dealers of Lightning: Xerox PARC and the Dawn of the Computer Age. ... A more forgiving Undo facility was later provided. It reloaded the file and replayed ...
  11. [11]
    The Long Road to 64 Bits - ACM Queue
    Oct 10, 2006 · The transition to 64-bit was long due to hardware, software, and standards issues, and the need for 64/32-bit CPUs to address larger memory.
  12. [12]
    Tech Time Warp of the Week: The Apple Lisa, 1983 - WIRED
    Oct 25, 2013 · One of its signature functions was "Undo Last Change," which BYTE called a "tremendous security blanket that enables you to experiment and work ...
  13. [13]
    USRE38270E1 - Multiple level undo/redo mechanism
    A multiple-level undo/redo mechanism is provided in an operating system and is available to application programs run on the operating system.
  14. [14]
  15. [15]
    Undo and redo | Apple Developer Documentation
    Undo and redo gives people easy ways to reverse many types of actions, which can also help people explore and experiment safely as they learn a new interface ...
  16. [16]
    Snackbar - Material Design 3
    A snackbar can contain a single action. "Dismiss" or "cancel" actions are optional. Snackbar showing 'Email archived' text with an 'Undo' text button. link.Missing: 2023 | Show results with:2023
  17. [17]
    Undo support models - ScienceDirect.com
    Undo support allows a user to reverse the effects of commands that have already been executed. In this paper, characteristics of undo support are reviewed.
  18. [18]
    A selective undo mechanism for graphical user interfaces based on ...
    Although linear undo provides an arbitrarily long history, it is not possible to undo isolated commands from the history without undoing all following commands.
  19. [19]
    US&R: A new framework for redoing (Extended Abstract)
    US&R (which stands for Undo, Skip, & Redo) is a new interactive approach to user recovery that offers significant advantages over current Undo/Redo packages.
  20. [20]
    [PDF] Management of Undo/Redo Operations in Complex Environments
    Several models have been presented, each deals with the undo and redo in its own way. 4.2.1 Script Model. This model was presented by Archer et al. in 1984[5].
  21. [21]
    Object-based nonlinear undo model - ACM Digital Library
    Many nonlinear undo models have been proposed for such operations. The user may also want to select any object and recover its state. Unfortunately, most undo ...
  22. [22]
    Undo edits and manage design history in Illustrator
    Jul 17, 2024 · Use History panel · Choose Window > History. · To undo a specific change, select the state and click Step Backward from the History panel menu.Learn How To Undo, Redo, Or... · Revert To The Last Saved... · Use History PanelMissing: selective | Show results with:selective
  23. [23]
    Selective Undo Support for Painting Applications - ACM Digital Library
    Selective undo allows users to undo any operation in the history and is considered a key feature in collaborative applications. Operational transformation (OT) ...Missing: earliest | Show results with:earliest
  24. [24]
    Filter undo and redo for editing—ArcGIS Pro | Documentation
    To filter the undo stack to undo only editing operations, click the Undo drop-down arrow and click Editing. If the undo stack doesn't contain at least one ...Missing: selective | Show results with:selective
  25. [25]
    Keyboard shortcuts in Final Cut Pro for Mac - Apple Support
    Select the clip above the current timeline selection at the skimmer or playhead location. Select Clip Above. Command-Up Arrow ; Select the clip below the current ...
  26. [26]
    Undo any operation at any time in group editors - ACM Digital Library
    In this paper, we contribute a novel group undo solution with such a capability. The basic idea is to interpret an undo command as a concurrent inverse ...
  27. [27]
    How Figma's multiplayer technology works | Figma Blog
    Oct 16, 2019 · A peek into the homegrown solution we built as the first design tool with live collaborative editing.Background Context: Figma's... · How Ots And Crdts Informed... · The Details Of Figma's...
  28. [28]
    A CRDT Supporting Selective Undo for Collaborative Text Editing
    However, even after over two decades of active research and development, support of undo for real-time collaborative editing is still very limited. We examine ...
  29. [29]
    [PDF] Collaborative Model-Driven Software Engineering - Dr. Istvan David
    Jan 31, 2023 · Version branching. Undo-redo support during collaboration. History. Conflicts and consistency. Locking. Prevention of conflicts. Conflict ...
  30. [30]
    Document collaboration and co-authoring - Microsoft Support
    Co-authoring allows multiple people to work together on documents in OneDrive or SharePoint, using supported apps and modern file formats. Sharing is key to ...Missing: undo branching 2020s
  31. [31]
    [PDF] Version Control for Asynchronous Group Work 1 Introduction
    The trees allow both version branching and merging, so are strictly directed acyclic graphs (DAGs), but we will continue to use the term tree. At any moment ...
  32. [32]
    Supporting String-Wise Operations and Selective Undo for Peer-to ...
    This paper presents an approach that combines and extends OT and CRDT strengths. It is fully decentralized and supports string-wise editing operations and ...
  33. [33]
  34. [34]
    Collaborative Document Editing: Strategies to Boost Teamwork in ...
    May 22, 2025 · AI systems now detect these conflicts early and suggest intelligent resolutions or highlight sections needing review, preventing confusion and ...<|control11|><|separator|>
  35. [35]
    Suggested edits – Notion Help Center
    Type text into the page to suggest adding it, or delete text to suggest removing it. Your suggestions will appear in the side of the page.
  36. [36]
    Conflict Resolution in Real-Time Collaborative Editing | Hoverify
    Oct 12, 2024 · Explore effective conflict resolution strategies in real-time collaborative editing, leveraging AI and innovative methods for improved ...
  37. [37]
    Design Patterns: Elements of Reusable Object-Oriented Software
    A comprehensive guide presenting 23 design patterns for object-oriented software development, offering flexible and reusable solutions to common programming ...
  38. [38]
    Overview of Qt's Undo Framework - Qt Documentation
    The Command pattern is based on the idea that all editing in an application is done by creating instances of command objects. Command objects apply changes to ...
  39. [39]
    Memento - Refactoring.Guru
    Memento is a behavioral design pattern that lets you save and restore the previous state of an object without revealing the details of its implementation.Memento in C# / Design Patterns · Memento in C++ · Memento in Python
  40. [40]
    Memento Design Pattern in Java | Baeldung
    Jan 8, 2024 · What Is the Memento Design Pattern? The Memento Design Pattern, described by the Gang of Four in their book, is a behavioral design pattern.
  41. [41]
    Design Pattern for Undo Engine - Stack Overflow
    Sep 8, 2008 · Most examples I've seen use a variant of the Command-Pattern for this. Every user-action that's undoable gets its own command instance with ...
  42. [42]