# Undo and checkpoints

> Take back the agent's changes in a static site, save and restore checkpoints in any project, and what each way back keeps and what it loses.
> Source: https://playcode.io/docs/build/undo-and-checkpoints - last reviewed 2026-10-10.
> Ask Playcode's agent: "Save a checkpoint called before the redesign." In a Cloud app it saves the checkpoint itself and asks you before any restore; in a static site you save and restore checkpoints yourself.

There are two ways back. In a static site, **Undo from here** takes back what the agent changed after one of your messages. In any project, a checkpoint is a saved point that you restore from **Checkpoint history…** in the project menu.

| Way back | Where | What goes back | What you lose |
|---|---|---|---|
| **Undo from here** | Under one of your earlier messages; static sites only | The files the agent changed after that message | The later messages, which leave the chat, and your own edits to those files since then |
| **Undo this change** | On a file change in the chat; static sites only | That change and every later change in the chat | The same |
| Restore a checkpoint in a static site | **Checkpoint history…** | All the project's files | Nothing: a checkpoint of the current files is saved first |
| Restore a checkpoint in a Cloud app | **Checkpoint history…** | One computer: its code, installed packages, database and files | Everything made on that computer after the checkpoint |

## Do it yourself

### Undo the agent's last changes (static site)

1. Find the message of yours after which things went wrong, and choose **Undo from here** under it.
2. Change the text if you want a different result.
3. Choose **Undo & resend**. The app asks "Undo changes and resend?": "All the AI's changes made after this message will be undone, and your project files will be restored to how they were at this point. The AI will then try your message again." Confirm with **Undo & resend**. This cannot be undone.
4. Wait for "Changes undone. The AI is trying again."

### Take back one change (static site)

1. In the chat, find the file change and choose its undo button (**Undo this change**).
2. If the agent made changes after it, Playcode asks first and names them: "Undo this change and the 2 after it?". Confirm with **Undo 3 changes**; the messages from there leave the chat. The newest change is undone at once, without a question.
3. Playcode says "Changes undone successfully".

### Save a checkpoint

1. Open the project menu (☰ and the project name, at the top left) and choose **Checkpoint history…**. In a Cloud app, the clock button (**Checkpoints**) at the top opens it too.
2. In a static site, choose **New checkpoint**. It saves at once, named by its date and time: "Checkpoint created. Restore from here anytime." Click the name to rename it, like "Before the redesign".
3. In a Cloud app, choose **New checkpoint** in the **DEV** or **PROD** section, give it a name and choose **Create checkpoint**. See [Snapshots and rollback](/docs/publish/snapshots-and-rollback).

### Restore a checkpoint

1. Ask the user before you restore a checkpoint in a Cloud app: the restore discards everything made on that computer after the checkpoint.
2. Open **Checkpoint history…**, find the checkpoint and choose **Restore**.
3. In a static site, confirm in "Restore this checkpoint?". The app says: "A checkpoint of the current state is saved first, so you can undo this. The page does not reload - your chats stay exactly where they are." The chat then shows "Restored to checkpoint" with its name, so the agent knows.
4. In a Cloud app, a production restore asks you to confirm: "Your live site changes for everyone the moment this completes." The page reloads when the restore is done. See [Snapshots and rollback](/docs/publish/snapshots-and-rollback).

> [!TIP]
> Save a checkpoint before a redesign or any big change, and after a version you like. In a static site, saving one does not use credits.

## If it doesn't work

### Undo from here is missing

The project is a Cloud app: a chat cannot undo what already ran on its computers, so restore a checkpoint instead. In a static site, the button shows only under a message of yours that has later messages after it.

### "Save this checkpoint?"

The project already has 20 checkpoints of yours: "You have 20 checkpoints, the limit." Choose **Create checkpoint** to delete the oldest one and save the new one, or delete a checkpoint you no longer need first.

### "The project is not open in the editor yet. Try again in a moment."

The project's files are still loading. Wait a moment and choose **New checkpoint** again.

### "Could not save the safety checkpoint of your current files. Nothing was restored."

Playcode could not save the current files first, so it did not restore. Try again, or [ask a person](/docs/help/get-help-from-a-person).

### "Checkpoint restored, but the AI chat could not be notified."

The files are back, but the agent does not know. Mention the restore in your next message.

## Limits

- Undo works in static sites only, on the changes the agent made with its file tools in this chat. It does not change the published site until you publish again.
- Undo puts each changed file back to its earlier content, so your own edits to those files since then are lost too. There is no redo. If you are unsure, save a checkpoint first.
- **Undo & resend** runs your message again, and that run uses credits.
- A static site keeps up to 20 checkpoints of yours. Playcode also keeps the newest 10 **Pre-publish** checkpoints, saved by each publish, and the newest 5 **Pre-restore** checkpoints, saved by each restore. These do not count toward the 20.
- A static site's checkpoint holds the project's files. Chats are not part of it, and a restore never changes them.
- In a static site, anyone who can edit the project can save and restore checkpoints, and the agent cannot. In a Cloud app, the project's creator or an Admin can, and the agent saves checkpoints itself before risky work. Each Cloud computer keeps up to 20 checkpoints of yours and the agent's.
- To try two directions at once in a static site, open the project menu, choose **Project**, then **Remix this project**: the copy is a separate project with its own files.
