# Undo, versions, and going back

> Made a change you regret? Every publish is a restorable version, and there is more than one way back.

Every builder eventually asks the same question: "the app was working a minute ago, how do I get back there?" Vaulter gives you three ways back, each suited to a different situation. This page walks through all of them, from the quickest to the most drastic.

## The three ways back, at a glance

| You want to undo | Use | Where |
| --- | --- | --- |
| The last change the agent made | The **Undo** button | On the agent's message in chat |
| A bad change that is already live | **Roll back** | Vault → Deployments |
| Several changes, described in your own words | Ask the agent to revert | Chat |

## Undo the agent's last change

When the agent changes your app's files, its message in chat shows exactly which files it touched. On the most recent of those messages you will see an **Undo** button.

Clicking it restores every touched file to exactly what it contained before that change. This is a mechanical restore from a snapshot taken at the moment the change was applied. No AI is involved, nothing is regenerated, and it costs no tokens. The preview rebuilds automatically with the restored files.

Undo covers the **most recent** change only. Once you send another message that changes files, the older Undo button is gone. To step further back, use one of the other two routes on this page.

## Roll back your live app

Every publish is recorded as a numbered version in **Vault → Deployments**, with the full built app stored alongside it. If a publish turns out to be a mistake, you do not have to fix forward under pressure. You can put a previous version back live first, then fix at your own pace.

### Open Vault → Deployments

In the build workspace, open the **Vault** tab and pick **Deployments**. You will see the version history: one row per publish, newest first, with the live one marked.

### Find the version that was good

Each row shows its version number and when it went live. Pick the most recent version from before the problem appeared.

### Click Roll back

On any past version, click **Roll back** and confirm. Vaulter creates a fresh deployment from that version's stored files and makes it live. Your app's address does not change, and the switch takes effect as soon as the copy completes, usually within seconds.

Two things worth knowing about rollback:

- **It does not count against your daily publish allowance.** Rolling back is recovery, not a new publish, and Vaulter treats it that way.
- **It changes the live app, not your working copy.** The preview and the code you are editing stay exactly as they are. That is deliberate: your users see the good version again immediately, while you keep the newer (broken) state in front of you to diagnose and fix. When the fix is ready, publish as normal.

## Ask the agent to revert

For everything between "the very last change" and "a whole published version", describe what you want undone in chat:

> Remove the reviews section you added earlier and put the pricing cards back the way they were this morning.

The agent rewrites the code to match. This is the most flexible route, and the only one that can partially undo something, but it is a normal AI edit: it uses tokens, and you should check the result in the preview like any other change.

Before a risky experiment, make yourself a safety copy: open your project's menu on the dashboard and choose **Duplicate**. You get a complete independent copy of the project to experiment in, and your original stays untouched.

## What about the code editor?

If you are editing code by hand in the [code editor](/docs/your-app/code-editor), the editor has ordinary text undo (Ctrl+Z, or Cmd+Z on a Mac) for the changes you have not saved yet. Once a change is saved and built, going back means one of the three routes above.

## Frequently asked

#### Does Undo cost tokens?

No. The Undo button is a snapshot restore, not an AI operation. Asking the agent to revert something in chat, on the other hand, is a normal request and uses tokens like any other.

#### Can I roll back more than once?

Yes. Every past version with stored files can be rolled back to, at any time, in any order. Rolling back also does not delete anything: the version you rolled away from stays in the history, so you can roll forward to it again.

#### Does rolling back change my database?

No. Rollback restores your app's files only. Data your users created stays exactly as it is, which is almost always what you want. If a change added new tables or columns, they remain in the database after a rollback; they are simply unused until you publish code that uses them again.

#### I undid a change but the preview still shows it

The preview rebuilds after an undo, which takes a few moments. If it still looks wrong after the rebuild finishes, reload the preview. See [Troubleshooting](/docs/reference/troubleshooting) if it persists.
