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

# Undo an AI Turn

> Revert everything a single AI turn changed

Every prompt you send to the AI captures a restore point of your project. If a turn goes in the wrong direction, one click brings your project back to exactly the state it was in before that prompt ran -- files the turn modified are restored, and files the turn added are removed.

## The checkpoint marker

A thin checkpoint strip sits above each prompt in the chat:

* **Saving checkpoint...** -- the restore point is being captured
* **Saved** -- the strip shows an **Undo this turn** button for as long as the restore point is available
* **Failed** -- an amber warning tells you this turn will not be undoable; reload the editor if you want a fresh restore point before your next prompt

The restore point reflects your project as of the moment you sent the prompt, so it never contains the turn's own changes -- even when the AI starts working immediately.

## Undoing a turn

<Steps>
  <Step title="Click Undo this turn">
    Find the checkpoint strip above the prompt you want to undo and click **Undo this turn**.
  </Step>

  <Step title="Review what will be undone">
    A confirmation dialog lists every file the turn touched, each tagged as created, modified, or deleted. If later prompts have run since, the dialog tells you how many later turns will also be rolled back.
  </Step>

  <Step title="Confirm">
    Before anything changes, your current state is saved as a pinned safety checkpoint (named "Before undoing" plus the prompt label), so the undo itself is reversible. Then the restore runs.
  </Step>

  <Step title="Watch the progress">
    The dialog shows named phases with elapsed time: pinning your current state, restoring files, and pushing the restored files to your preview. You can send the dialog to the background and keep working -- closing it never cancels the restore.
  </Step>

  <Step title="Read the outcome">
    When the restore finishes you get a plain summary: how many files were restored, how many already matched and were left alone, and which files added after the restore point were removed (with a list of the removed paths). Your preview refreshes automatically with the restored files.
  </Step>
</Steps>

## What gets rolled back

| Change                                 | What undo does                                                                           |
| -------------------------------------- | ---------------------------------------------------------------------------------------- |
| Files the turn modified                | Restored to their content from before the prompt ran                                     |
| Files the turn created                 | Removed from the project                                                                 |
| Anything added after the restore point | Removed -- including files you created or uploaded yourself, not just the turn's changes |
| Later AI turns                         | Rolled back along with the turn you are undoing                                          |
| Images and other assets                | Restored; an asset may come back at its latest available content                         |
| Files that already match               | Left untouched and reported separately                                                   |

<Warning>
  Undo reverts everything added to the project after the restore point, not only what the AI wrote. If you uploaded files or made manual edits after the prompt ran, they are removed too. The pinned safety checkpoint can bring them back.
</Warning>

<Note>
  Undoing a turn changes your editor and preview only. Your live site is unchanged until you deploy again. See [Checkpoints](/editor/checkpoints) for how restore points work project-wide.
</Note>

## Undoing an undo

Every undo starts by pinning your current state as a safety checkpoint. To reverse an undo, open your project's checkpoint history, find the checkpoint named "Before undoing" for that turn, and restore it. See [Checkpoints](/editor/checkpoints) for the full restore flow.
