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

# Branching & Rollback

> Go back to any previous version of your work or try multiple directions in parallel.

Branching and rollback let you undo changes and explore different directions without losing your work. Both are available in Agent Mode only.

## Rollback

Rollback takes your conversation and sandbox back to a previous point. The agent's sandbox, your canvas, and all generated files are restored to exactly how they were at that message.

### How to rollback

<Steps>
  <Step title="Hover over a previous message">
    Find the message you want to go back to. Hover over it to reveal the action buttons.
  </Step>

  <Step title="Click Rollback">
    Click the **Rollback** button. The conversation rewinds to that point. All messages after it are removed.
  </Step>

  <Step title="Continue from there">
    Your sandbox and canvas are restored to the exact state they were in at that message. Send a new message to continue in a different direction.
  </Step>
</Steps>

**Example:** You asked the agent to build a pricing page for your fitness studio. It built one with vertical cards. You then asked it to make them horizontal, but you preferred the original. Rollback to the message before the horizontal change. The vertical version is back, and you can try a different approach.

### What you cannot do with rollback

* You cannot rollback in Chat Mode (Agent Mode only).
* You cannot rollback to a message that has no checkpoint. Checkpoints are created after each agent response.
* You cannot undo a rollback. Once you roll back, the later messages are gone. If you want to keep both versions, use branching instead.

## Branching

Branching creates a new, independent chat starting from any message in your current conversation. The new chat gets its own copy of the sandbox, so you can take it in a completely different direction without affecting the original.

### How to branch

<Steps>
  <Step title="Hover over a message">
    Find the point where you want to fork the conversation.
  </Step>

  <Step title="Click Branch">
    Click the **Branch** button. A new chat opens with the conversation up to that point and a fresh clone of the sandbox.
  </Step>

  <Step title="Take it in a new direction">
    The original chat stays exactly as it was. The new chat is independent. You can try a completely different approach.
  </Step>
</Steps>

**Example:** You built a landing page for your coffee subscription service. You want to test two different designs: one minimal with lots of whitespace, and one bold with dark backgrounds and large images. Branch at the point where the basic structure is done. Now you have two independent chats, each with its own sandbox, where you can explore both directions.

### What you cannot do with branching

* You cannot branch from Chat Mode (Agent Mode only).
* You cannot branch without a message checkpoint (the sandbox needs a snapshot to clone).
* You cannot merge branches back together. Each branch is a fully independent chat.

## When to use which

| Situation                                                        | Use                                           |
| ---------------------------------------------------------------- | --------------------------------------------- |
| You want to undo a change and try again                          | Rollback                                      |
| You want to keep the current version AND try something different | Branch                                        |
| You want to test 2 or 3 different approaches side by side        | Branch from the same point multiple times     |
| The agent went in the wrong direction on the last step           | Rollback one message                          |
| You want to preserve a "safe" version before a risky change      | Branch first, then experiment in the new chat |

<Tip>
  Before making a big change (like restyling an entire website or restructuring a presentation), branch first. If the change does not work out, your original is untouched in the other chat.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="File Uploads" icon="upload" href="/choosing-your-ai-model">
    Upload images, documents, and other files for the agent to use as context.
  </Card>

  <Card title="How the Agent Works" icon="robot" href="/how-the-agent-works">
    Understand the full agent loop from prompt to finished output.
  </Card>
</CardGroup>
