# Undo an action

```
 Action    name: Undo
 
```

This command reverts the database to the state before executing the last user action. It is possible to apply Undo multiple times, in this case multiple user actions will be reverted.

Please note the entire database is reverted, including all modifications that were made to the database after executing the user action and including the ones that are not connected to the user action. For example, if a third party plugin modified the database during or after the user action, this modification will be reverted. In theory it is possible to go back in time to the very beginning and revert the database to the state state that was present immediately after performing the very first user action. However, in practice the undo buffers overflow because of the changes made by autoanalysis. [Autoanalysis](https://docs.hex-rays.com/9.0/user-guide/user-interface/options#analysis-options) generates copious amounts of undo data. Also please note that maintaining undo data during autoanalysis slows it down a bit. In practice it is not a big deal because the limit on the undo data is reached quite quickly (in a matter of minutes). Therefore, if during analysis the user does not perform any actions that modify the database, the undo feature will turn itself off temporarily.

However, if you prefer not to collect undo data at all during the initial autoanalysis, just turn off the UNDO\_DURING\_AA parameter in [ida.cfg](https://docs.hex-rays.com/9.0/user-guide/configuration/configuration-files).

The configuration file [ida.cfg](https://docs.hex-rays.com/9.0/user-guide/configuration/configuration-files) has 2 more undo-related parameters:

```
  UNDO_MAXSIZE  max size of undo buffers; default: 128MB
                once this limit is reached, the undo info about the oldest
                user action will be forgotten.

  UNDO_DEPTH    max number of user actions to remember; default: 1000000
                if set to 0, the undo feature will be unavailable.
```

Since there is a limit on the size of undo buffers, any action, even the tiniest, may become non-undoable after some time. This is true because the analysis or plugins may continue to modify the database and overflow the buffers. Some massive actions, like deleting a segment, may be non-undoable just because of the sheer amount of undo data they generate.

Please note that Undo does not affect the state of IDC or Python scripts. Script variables will not change their values because of Undo. Also nothing external to the database can be changed: created files will not be deleted, etc.

Some actions cannot be undone. For example, launching a debugger or resuming from a breakpoint cannot be undone.

See also

* [Redo](https://docs.hex-rays.com/9.0/user-guide/user-interface/menu-bar/edit/redo-an-action)
* [Reset Undo](https://docs.hex-rays.com/9.0/user-guide/user-interface/menu-bar/edit/clear-undo-history)
* [Disable Undo](https://docs.hex-rays.com/9.0/user-guide/user-interface/menu-bar/edit/disable-undo)
* [Open undo history](https://docs.hex-rays.com/9.0/user-guide/user-interface/view/open-subviews#show-undo-history)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/9.0/user-guide/user-interface/menu-bar/edit/undo-an-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
