“Undo changes your app’s code, not its data.” Rows in your database and files your app stored aren’t rolled back.
Restore to here
Restore to here appears under each of your messages that produced a saved version. It takes your code back to how it was right after the agent finished that turn.1
Stop the agent if it's working
You can’t restore while a turn is running. Restore to here is greyed out until the agent finishes or you stop it.
2
Find the message
Scroll to the message whose result you want to go back to.
3
Select Restore to here
Select Restore to here under that message.
4
Continue chatting
When it’s done, you’ll see “Restored that version. Your next message will continue from it.”
Undo
When Developer mode is off, an Undo button sits at the top right of the window while a chat is open. Hover over it to see what it does: “Goes back to the version before your last change.” Undo stays greyed out until the chat has at least two saved versions. Until then, hovering over it adds “This session has no earlier version yet.”What happens when you restore
- The chat parks first. Newly parks the chat, restores the code, and your next message continues from the restored version. See Parked chats and limits.
- A restore adds a new version. Your later versions aren’t deleted. The restore is saved on top of them, so you can undo an undo by selecting Restore to here on a later message.
- It changes
devfor the whole project. By default, all chats in a project work on the samedevbranch, so every chat sees the restored code. See Where your code lives. - It doesn’t change
main. If you already promoted tomain, promote again after restoring if you wantmainto match. - Your chat stays as it was. Restoring changes code only. The messages above and below stay in the chat.
What isn’t restored
Restoring brings back your app’s code. It doesn’t roll back:- data in your app’s database, such as users or records your app created
- files your app uploaded or stored
- anything outside the project’s code
Credits
Restoring doesn’t run the agent, so it doesn’t use credits. Only the messages you send afterwards do. See How credits work.If a restore fails
Related pages
Where your code lives
Saved versions, branches and Promote to main.
Chatting with the agent
Sending, stopping and queueing messages.