> ## 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

> This guide shows you how to reverse and replay changes in Nextedy GANTT using the built-in undo and redo functionality.

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>;
};

<Info title="Verify in application">
  This page is based on source code analysis. Some UI details may vary depending on your version. Verify the behavior in your Gantt installation.
</Info>

## Prerequisites

* A Gantt widget in Edit mode
* Undo/redo is loaded automatically at Gantt startup -- no additional configuration is required

## How Undo and Redo Works

The Gantt maintains a history of changes made during an edit session. Each time you move a task bar, resize a task, or modify a value, the action is recorded. You can step backward through these changes with **Undo** and forward again with **Redo**.

| Setting      | Default Value | Description                                          |
| ------------ | ------------- | ---------------------------------------------------- |
| `undo_steps` | `10`          | Maximum number of changes stored in the undo history |

The undo history is cleared when you exit Edit mode or save your changes.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/DDjWgCW2DWY5biNv/gantt/diagrams/guides/editing/undo-redo/diagram-1.svg?fit=max&auto=format&n=DDjWgCW2DWY5biNv&q=85&s=58a63cfb025cd0ff03cfeca3c5ff1efc" alt="diagram" style={{ maxWidth: "860px", width: "100%" }} width="860" height="200" data-path="gantt/diagrams/guides/editing/undo-redo/diagram-1.svg" />
</Frame>

## Use the Undo and Redo Buttons

1. Click  **Edit** in the Gantt toolbar to enter Edit mode
2. Make one or more changes -- for example, drag a task bar to a new date
3. Click the **Undo** button in the toolbar to reverse the last change
4. Click the **Redo** button to reapply a previously undone change
5. Continue undoing or redoing as needed, up to the `undo_steps` limit

<Warning title="Undo buttons visible only in Edit mode">
  The Undo and Redo buttons appear in the toolbar **only** when the Gantt is in Edit mode. If you do not see them, click the **Edit** button first.
</Warning>

## Change the Undo History Depth

By default, the Gantt stores up to 10 undo steps. To increase or decrease this limit, modify the Gantt Config Script:

1. Open the Polarion page containing the Gantt widget
2. Edit the widget properties
3. Navigate to **Advanced > Gantt Config Script**
4. Set the `undo_steps` property:

```javascript theme={null}
gantt.config.undo_steps = 25;
```

This allows up to 25 undo operations in a single edit session.

<Info title="Verify in application">
  Higher undo step values consume more browser memory. For large Gantt charts with many tasks, test the impact of increasing this value on client-side performance.
</Info>

## Interaction with Editing Modes

The availability of undo and redo depends on your editing configuration:

| Configuration                | Undo/Redo Available    | Notes                                                       |
| ---------------------------- | ---------------------- | ----------------------------------------------------------- |
| Default (Edit/Close buttons) | Yes, in Edit mode only | Buttons appear after clicking Edit                          |
| `alwaysedit = true`          | Yes, always visible    | Gantt is always in edit mode                                |
| `readonly = true`            | No                     | All editing is disabled                                     |
| `hideToolbar = true`         | Not in toolbar         | Toolbar is hidden; `hideToolbar` forces `alwaysedit = true` |

<Tip title="What-if analysis with undo">
  Use undo as a lightweight what-if tool. Drag tasks to explore schedule alternatives, then undo all changes to return to the original state without saving. For a more structured approach, see [Perform What-If Analysis Without Saving](/gantt/guides/scheduling/what-if-analysis).
</Tip>

## Verify Your Configuration

1. Enter Edit mode in the Gantt
2. Drag a task bar to a new date position
3. Click **Undo** in the toolbar
4. You should now see the task bar return to its original position
5. Click **Redo** to move it back to the new position

## See Also

* [Handle Unsaved Changes and Session Timeout](/gantt/guides/editing/unsaved-changes) for understanding change persistence
* [Configure the Toolbar and Menus](/gantt/guides/layout/toolbar-configuration) for toolbar button visibility
* [Perform What-If Analysis Without Saving](/gantt/guides/scheduling/what-if-analysis) for exploring schedule alternatives
* [Use the Lightbox Inline Editor](/gantt/guides/editing/lightbox-editor) for editing work item fields

<LastReviewed date="2026-07-02" />
