> For the complete documentation index, see [llms.txt](https://docs.fullscreen.no/info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fullscreen.no/info/standalone-assets/runtime-studio/api/undo-and-redo.md).

# Undo & Redo

Runtime Studio provides a simple undo system for runtime editor actions.

***

### Basic Undo

```cs
RuntimeStudioUndo.RecordAction(
    "Add Health",
    () =>
    {
        gameObject.AddComponent<MyHealth>();
    }
);
```

***

### Batch Operations

```cs
using (RuntimeStudioUndo.Begin("Move Objects"))
{
    foreach (var obj in objects)
    {
        obj.transform.position += offset;
    }
}
```

***

### Alias

```cs
RuntimeStudioUndo.Run("Action", () => { });
```

***

### Undo Rules

* Always wrap scene mutations
* Always wrap hierarchy changes
* Always wrap component additions/removals
* Do not wrap pure UI updates

***

### Undo State

```cs
RuntimeStudioUndo.CanUndoRuntimeStudioUndo.CanRedoRuntimeStudioUndo.Changed
```

***

### Important Notes

* Nested scopes are merged
* Built-in inspector fields already record undo
* Custom tools must manually record undo
