> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Undo and Redo

> Revert and reapply changes in Nextedy RISKSHEET using the undo/redo system, which tracks cell edits, row operations, paste actions, and cascading dependent enum updates.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Undo a Change

1. Press **Ctrl+Z** (or **Cmd+Z** on macOS) to undo the most recent change
2. The grid reverts to its previous state and scrolls automatically to show the affected row
3. Repeat to undo additional changes, up to the last 50 actions

## Redo a Change

1. Press **Ctrl+Y** (or **Ctrl+Shift+Z** on macOS) to reapply the most recently undone change
2. The grid restores the change and positions the view on the affected row

<Warning title="New Edits Clear the Redo Stack">
  If you undo several changes and then make a new edit, all undone changes are permanently removed from the redo history. You cannot redo them after making a new edit.
</Warning>

## What Can Be Undone

The undo stack tracks the following types of operations:

| Operation                   | Undo Behavior                                                                |
| --------------------------- | ---------------------------------------------------------------------------- |
| **Cell edits**              | Restores previous cell value and row height                                  |
| **Paste operations**        | Reverts all pasted cells as a single action                                  |
| **Row addition**            | Removes the added row and scrolls to previous position                       |
| **Row deletion**            | Restores the deleted row (with limitations for unsaved items)                |
| **Dependent enum cascades** | Reverts all cascading child field changes together                           |
| **Task removal**            | Restores removed task or cleared task fields                                 |
| **Linked column changes**   | Restores dependent column values for `itemLink`, `multiItemLink`, `taskLink` |

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/-Icoak49xQVOW38R/risksheet/diagrams/guides/advanced/undo-redo/diagram-1.svg?fit=max&auto=format&n=-Icoak49xQVOW38R&q=85&s=b6a8a61df533bba12e4fbd33dd513314" alt="diagram" style={{ maxWidth: "640px", width: "100%" }} width="640" height="190" data-path="risksheet/diagrams/guides/advanced/undo-redo/diagram-1.svg" />
</Frame>

## Undo Cascading Dependent Enum Changes

When you edit a parent enum field that triggers cascading updates to child fields via the configured dependent enum mapping, the entire cascade is tracked as a single undo action:

1. Change a parent enum value — child fields update automatically
2. Press **Ctrl+Z** — both the parent change and all child field updates are reverted together
3. Press **Ctrl+Y** — the parent change and all cascading updates are reapplied

This applies to both single-row edits and bulk edits across multiple selected rows.

## Undo Multi-Cell Paste Operations

When you paste values into multiple cells, the entire paste operation is bundled as a single undo action. Pressing **Ctrl+Z** reverts all pasted cells at once rather than requiring individual cell-by-cell undo.

## Undo Linked Column and Merged Cell Changes

Undo operations on `itemLink`, `multiItemLink`, `taskLink`, and `multiEnum` columns automatically restore dependent column values. For merged cells (common in `itemLink` columns within hierarchical levels), the undo operation applies across all rows in the merged cell range.

Multi-enum fields use specialized undo logic that converts between internal IDs and visible values, ensuring the display remains consistent after undo/redo.

## Undo Task Operations

Task operations support full undo:

* **Task addition**: Undoing a task addition removes the added task row and restores the grid to the previous position
* **Task removal**: Undoing a task removal restores the task. For single-task items where task fields were cleared, undo restores all cleared task attributes

<Warning title="Cannot Undo Deletion of Unsaved Items">
  If you delete a row for a newly created work item that has not been saved (identifiable by a temporary ID), undo cannot restore it. A warning message appears: "It is not possible to Undo deletion of unsaved items." Always save new items before performing delete operations.
</Warning>

## Limitations

| Limitation                | Details                                                             |
| ------------------------- | ------------------------------------------------------------------- |
| **Stack size**            | Maximum 50 undo actions. Older actions are automatically discarded. |
| **Unsaved item deletion** | Deleted new (unsaved) items cannot be restored via undo.            |
| **Save operations**       | Saving the document is not an undoable action.                      |
| **Redo after new edit**   | Making any new change clears the entire redo stack.                 |
| **Page reload**           | Undo history does not persist across page reloads.                  |

<Tip title="Save Frequently">
  Since undo history is limited to 50 actions and resets on page reload, save your document regularly. After saving, undo still works within the current session for reverting unsaved changes.
</Tip>

## Verify Undo/Redo

After making changes:

1. Edit a cell value, then press **Ctrl+Z** — the original value should reappear
2. Press **Ctrl+Y** — the edited value should be restored
3. Add a row, then undo — the row should be removed and the grid scrolls to the previous position
4. Edit a parent enum with cascading dependents, then undo — all cascading child fields should also revert

You should now see undo and redo working consistently for cell edits, row operations, paste actions, and cascading enum changes.

## See Also

* [Perform Bulk Editing](/risksheet/guides/advanced/bulk-editing) — multi-cell operations that create undo entries
* [Configure Dependent Enums](/risksheet/guides/advanced/dependent-enums) — cascading enum relationships tracked by undo
* [Configure Remove/Delete Actions](/risksheet/guides/risk-management/remove-delete-risk) — task removal behavior

<LastReviewed date="2026-06-24" />
