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

# Undo a change and go back a version

> Every Rork message is a version you can return to. Undo the last change, revert to any earlier answer, review the exact files that changed, and stop a message that is going the wrong way.

export const CtaBanner = () => <div style={{
  display: "flex",
  alignItems: "center",
  justifyContent: "space-between",
  gap: "24px",
  flexWrap: "wrap",
  margin: "40px 0 8px",
  padding: "22px 28px",
  borderRadius: "16px",
  background: "linear-gradient(135deg,rgba(249,115,22,0.10),rgba(255,255,255,0.03),rgba(249,115,22,0.06))",
  border: "1px solid rgba(255,255,255,0.08)"
}}>
    <div>
      <div style={{
  fontSize: "19px",
  fontWeight: 700,
  color: "#fff",
  letterSpacing: "-0.3px",
  lineHeight: 1.3
}}>
        Build your app with Rork today.
      </div>
      <div style={{
  fontSize: "14px",
  color: "rgba(255,255,255,0.6)",
  marginTop: "4px",
  lineHeight: 1.5
}}>
        Ship iOS, Android, and web apps by chatting with AI.
      </div>
    </div>
    <a href="https://rork.com?utm_source=docs&amp;utm_medium=referral&amp;utm_campaign=docs-cta&amp;utm_content=cta-banner" onClick={tagCtaLink} style={{
  flexShrink: 0,
  display: "inline-block",
  padding: "10px 24px",
  background: "linear-gradient(135deg,#fff,#f0f0f0)",
  color: "#000",
  fontSize: "14px",
  fontWeight: 600,
  borderRadius: "100px",
  textDecoration: "none",
  whiteSpace: "nowrap"
}}>
      Try Rork for Free
    </a>
  </div>;

Nothing you do in Rork is final. Each answer from the agent is a saved version of your whole project, so you can always go back to the last one that worked.

Going back costs no credits.

## Undo the last change

The last answer in the chat has an **Undo** button under it. Press it and Rork rolls the files back, then removes that exchange from the chat. There is no dialog, because there is nothing to lose: the version you land on is the one you had a minute ago.

<Frame caption="The action row under an answer: Undo, copy, and the ⋯ menu.">
  <img src="https://mintcdn.com/rork/wazWVatNruwoHCrq/images/history/message-actions.png?fit=max&auto=format&n=wazWVatNruwoHCrq&q=85&s=7154d2490138f200977dba645cff006a" alt="A Rork chat answer with a file list and an action row underneath showing Undo, a copy button, and a three dot menu" width="992" height="214" data-path="images/history/message-actions.png" />
</Frame>

Use **Undo** when the last change made things worse and you want the previous state back immediately.

## Go back several versions

Earlier answers show **Revert** instead of **Undo**. It puts your project back to how it looked right after that answer.

<Frame caption="Revert sits under every earlier answer in the chat.">
  <img src="https://mintcdn.com/rork/wazWVatNruwoHCrq/images/history/revert-button.png?fit=max&auto=format&n=wazWVatNruwoHCrq&q=85&s=989a49f4f0cc936d4a29354bea299c17" alt="The action row under an earlier Rork answer, showing a Revert control next to the copy and three dot buttons" width="992" height="264" data-path="images/history/revert-button.png" />
</Frame>

Revert asks first, because you may lose work that came later:

<Frame caption="The confirmation. Cancel leaves everything as it is.">
  <img src="https://mintcdn.com/rork/wazWVatNruwoHCrq/images/history/revert-dialog.png?fit=max&auto=format&n=wazWVatNruwoHCrq&q=85&s=1e4d862de9ba6e0d14b10a12f5320d8a" alt="A dialog titled Revert to Previous Version warning that unsaved changes will be lost, with Cancel and Revert buttons" width="1052" height="302" data-path="images/history/revert-dialog.png" />
</Frame>

After you confirm, Rork restores the files and trims the chat: the messages up to that answer stay, and everything after it goes. A toast tracks the work, first **Restoring project...** and then **Version restored**.

<Warning>
  Revert is not reversible. The versions after your target are no longer at the top of the history. Before a big revert, ask yourself whether you only need the last change undone.
</Warning>

You cannot revert while the agent is working. The button explains why: "Hang tight, the agent's still working. Stop the message to revert here."

## Edit a message and try again

Sometimes the answer was fine and the question was wrong. Hover an earlier message of yours and press **Edit message**. Fix the wording and press **Send**.

Rork puts the project back to the state before that message, drops everything that followed it, and answers your new wording. It is a revert and a retry in one step, and it is the cleanest way out of a conversation that went sideways.

## See exactly what changed

Every answer can show its own diff. Open the **⋯** menu under the answer and choose **Review changes**.

<Frame caption="The ⋯ menu: Review changes, the model that ran, the credits it used, and the size of the context.">
  <img src="https://mintcdn.com/rork/wazWVatNruwoHCrq/images/history/message-details.png?fit=max&auto=format&n=wazWVatNruwoHCrq&q=85&s=7f6982db7e329ee4d0ba074a0ff40afc" alt="The message details menu in Rork showing Review changes, Auto to Opus 5 High, 78.5 credits, and 121.4k context tokens" width="1001" height="479" data-path="images/history/message-details.png" />
</Frame>

The same menu answers "what did that cost?". It names the model that actually ran, the credits the message used, and how much context the agent carried.

**Review changes** opens a full-screen diff of every file the answer touched, compared with the version before it. The header counts the files, and **ESC** closes it.

<Frame caption="The diff view. Green is added, and the header counts the files that changed.">
  <img src="https://mintcdn.com/rork/wazWVatNruwoHCrq/images/history/diff.png?fit=max&auto=format&n=wazWVatNruwoHCrq&q=85&s=1e788f79b5821446ca0c7b7bf6321db9" alt="The Rork diff view showing rork.json and gitignore with added lines highlighted in green, and 88 files changed in the header" width="1849" height="1707" data-path="images/history/diff.png" />
</Frame>

Read the diff before you publish, and after any change you did not fully understand.

## Stop a message that is going wrong

While the agent works, the send button becomes a stop button. Press it and Rork finishes the step it is on, saves what it already did, and stops.

Stopping is safe and cheap:

* The partial work stays in the chat, marked **Stopped**, with the progress saved.
* Your prompt comes back into the composer, so you can reword it and send it again.
* A build that never finished is not charged.

Stop early. A long turn heading in the wrong direction costs more than a stop and a better prompt.

## Fix an error instead of undoing

If the preview throws an error, Rork shows it and offers to fix it. The dialog is titled **Runtime error** and the button says **Fix with Rork**. With several errors you get **Fix all with Rork**, or a count, and **Dismiss**.

By default, pressing that button sends the fix request straight away. You can change that in **Account settings → Preferences**:

<Frame caption="Turn Auto-send error fixes off to read the request before it goes.">
  <img src="https://mintcdn.com/rork/wazWVatNruwoHCrq/images/history/auto-send-fixes.png?fit=max&auto=format&n=wazWVatNruwoHCrq&q=85&s=fd1d93f18c2807c80b19b783a37ca07b" alt="The Preferences panel in Rork account settings showing the Auto-send error fixes toggle switched on" width="1266" height="384" data-path="images/history/auto-send-fixes.png" />
</Frame>

Two more places offer the same help. An answer with TypeScript problems gets a **Fix errors** button, and the **Logs** panel in **More → Code** shows what your app printed at runtime, which is what you paste into chat when an error is not obvious.

## What a version actually is

One answer from the agent equals one saved version of the project. Rork commits your files at the end of each turn, together with the chat history, so the chat and the code can never drift apart.

That has two useful consequences:

* The list of versions is the chat. There is no separate history panel to learn.
* Your project history travels with your code. Connect GitHub and you get the same commits in your own repository. See [How to sync your project with GitHub](/tutorials/how-to-connect-github).

## FAQ

<AccordionGroup>
  <Accordion title="Does Undo or Revert cost credits?">
    No. Going back to an earlier version is free. You only pay for messages that do work.
  </Accordion>

  <Accordion title="How far back can I go?">
    To any answer in the chat. Scroll up and older messages load as you go.
  </Accordion>

  <Accordion title="Can I undo a revert?">
    No. Cancel the dialog if you are unsure, and prefer **Undo** when you only need the last change back.
  </Accordion>

  <Accordion title="Does Revert also undo a publish?">
    No. Your live web app or your submitted build stays as it is until you publish again. See [Rork Web](/web/rork-web).
  </Accordion>

  <Accordion title="Does Revert bring back deleted secrets?">
    Environment variables are not part of the code version. Check **More → Secrets** after a revert. See [API keys and environment variables](/features/secrets).
  </Accordion>

  <Accordion title="The agent is stuck in a loop of failed fixes.">
    Revert to the last good version first, then narrow the request. [How to get out of an error loop](/introduction/introduction/agent-loops) walks through it.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card icon="sparkles" href="/features/agent-modes" title="How the agent works">
    Design mode, Plan mode, and building.
  </Card>

  <Card icon="triangle-alert" href="/introduction/introduction/agent-loops" title="Get out of an error loop">
    What to do when the same fix keeps failing.
  </Card>

  <Card icon="github" href="/tutorials/how-to-connect-github" title="Sync with GitHub">
    Keep the same history in your own repository.
  </Card>

  <Card icon="users" href="/collaborate/share-a-project" title="Share the project">
    Who can revert, and who can only look.
  </Card>
</CardGroup>

<CtaBanner />
