Skip to content
  • There are no suggestions because the search field is empty.

Restoring a previous version of your website

Go back to an earlier version of your site at any time, and learn what a restore does and doesn't change.

ronnel

Written by: Ronnel DG
Last updated: 12 Nov., 2026

When you or the AI Agent saves a change to your site, B12 automatically saves it as a version. To undo any changes, you can restore your site to any earlier version directly from the chat. If your site uses Backends (a database, sign-ins, or edge functions), this article also explains which parts a restore changes and how to bring the rest in line.

How versions work

B12 saves a new version automatically when the AI Agent changes your site, when you save in Visual edit or the code editor, when you add a skill, and each time you restore. You don't need to do anything to create one. Over time, your chat history fills up with cards. Each card is a saved version of your site:

  • AI edits: changes the AI Agent made
  • Visual edits: changes you saved in Visual edit
  • Code edits: changes you saved in the code editor, or a skill you added
  • Restored edits: a restore of an earlier version

Code edits card in the AI Agent chatAI edits card in the AI Agent chat with the Restore button

Each card tells you what changed, so you can find the version you want. AI edits cards describe the change, and Visual edits and Code edits cards list the files that changed, for example Updated index.astro. The most recent card doesn't show a Restore Restore button, because you're already on that version.

Restoring a previous version

To go back to an earlier state of your site, follow these steps:

Animation showing how to find an edits card in the chat and click Restore

  1. In the chat, scroll up to find the card for the version you want to restore to. Use the description in each card to identify the right one.
  2. Click Restore Restore on that card.
  3. In the Restore to previous version dialog, click Restore to confirm. Restoring usually takes under a minute.

Your site reverts to that version. All changes made to your site's files after that point are undone in the preview. A new Restored edits card appears in the chat.

Caution: Restoring a version updates your draft site, not your published site. Your live site stays the same until you click Publish.


What restoring changes (and what it doesn't)

A version is a copy of your site's files: its pages, design, and code. Restoring puts those files back the way they were. Anything that lives outside your site's files stays exactly as it is now.

Goes back to the earlier version Stays as it is now
  • Pages, text, images, and layout
  • Colors, fonts, and styles
  • Your site's code, including your edge function code and database migration files
  • Custom skills you've added under Agent → Skills
  • Your published site, until you publish again
  • The edge functions that are currently running
  • Your database tables, columns, and the data in them
  • Users who have signed up, and your sign-in settings
  • Secrets (API keys)
  • Form submissions and contacts

Caution: If a loop uses a skill you added after the version you restore, the restore removes that skill from the loop. The loop keeps running without it. Restoring a newer version brings the skill back, but not its link to the loop. To fix it, ask the AI Agent to add the skill back to the loop. You can type the request in the prompt box at the top of Agent → Loops. For example:

Add the [skill name] skill back to my [loop name] loop.

For most sites, that's all you need to know. If your site uses Backends Backends, read the next section. If you haven't turned on Backends yet, open it and click Enable Backends to see its sections. After a restore, your site's code and your live backend can be out of step.

Bringing your backend in line after a restore

Edge functions

Edge functions are small programs that run behind the scenes for your site (for example, sending an email when someone submits a form). A restore brings back the earlier code for your edge functions, but the live functions keep running the newer code until you sync them. To make the live functions match the version you restored, ask the AI Agent:

I just restored an earlier version. Sync my edge functions so the live functions match this version's code. Before you do, tell me which functions will be updated or deleted.

AI Agent chat after a restore, listing which edge functions syncing will update or delete before it syncs them

Caution: Syncing deletes any live edge function that isn't in the version you restored. If you added a function after that version, syncing removes it, and anything on your site that uses it stops working. Ask the AI Agent to list the changes first, as in the prompt above.

You can see which edge functions are live in Backends Backends → Edge functions.

Your database

Restoring doesn't undo database changes. Tables, columns, and the data in them stay exactly as they are. This keeps your data safe: restoring an older design never deletes bookings, sign-ups, or records your site has collected.

  • To view or edit the data itself, go to Backends Backends → Database. You can add or edit rows there.
  • To undo a change to the structure (a table or column you added later), ask the AI Agent. The Database pane can't change table structure.

Backends Database pane showing the rows of a bookings table, with the Add row button

My database still has the [table or column] I added after this version. Remove it, and tell me what data that will delete before you make the change.

The restored code may also expect an older database layout. If a page or form stops working after a restore, the code and the database probably no longer match. Ask the AI Agent to fix it:

After restoring, [page or form] isn't working. Check whether my code matches my current database and fix whichever one is out of date.

Users and secrets

People who signed up since that version keep their accounts, and you can still manage them in Backends Backends → Users. Secrets also stay as they are. If the restored version uses a secret you've since deleted, ask the AI Agent to check:

Check that all the secrets my edge functions need are set up.

The AI Agent tells you which secrets your edge functions need. If it asks you for one, enter it in the Add a secret card in the chat. You can also check or add secrets in Backends Backends → Secrets.

Returning to a more recent version

Restoring doesn't delete any versions. After you restore an older version, the newer versions are still in your chat, and you can restore any of them at any time.

For example: if you restore a version from two weeks ago, then decide it wasn't the right one, you can scroll up in your chat and restore a more recent version instead. The cards and their descriptions stay visible throughout your chat history.

Tip: Use the description in each card to orient yourself before restoring. If you're not sure which version is right, try restoring one. You can always switch to a different version afterward.

If your site uses Backends, switching versions again works the same way: sync your edge functions afterward so the live functions match.

Re-adding changes after restoring

After restoring a version, your site reflects exactly what it looked like at that point. If there were changes from a later version that you want to keep, you can ask the AI Agent to re-apply them.

Add back the [description of the change] that I had before. For example: [briefly describe what it looked like].

The more specific you are, the more accurately the AI Agent can reproduce the change. If you remember the exact wording, layout, or colors from the version you want to pull forward, include those details in your prompt.

Note: Re-applying removed changes may not reproduce them exactly. Review the result and refine your prompt if needed.

Frequently asked questions

→Can I lose a version permanently?

⇒No. B12 keeps all your versions. Restoring one version doesn't delete any others. You can always scroll through your cards and restore a different one.

→Can I manually save a version before making a change?

⇒You don't need to. Every change you save is already a version, so you can make a big change and restore the version before it if you don't like the result. Changes you haven't saved yet in Visual edit or the code editor aren't part of a version until you click Save.

→Does restoring affect my published site?

⇒No. Restoring updates your draft site only. Your published site stays the same until you click Publish. This means you can restore and review the result before deciding whether to publish.

→What's the difference between restoring and undoing?

⇒B12 doesn't have a traditional undo button. Restoring a version is the best way to undo a change. It rolls your site's files back to a specific saved state, and you can restore to any version in your history, not just the most recent change.

→Will restoring delete my form submissions, sign-ups, or database records?

⇒No. Restoring only changes your site's files. Form submissions stay in Form submissions, and database records stay in Backends Backends → Database.

→I restored a version, but my site still does something the newer version did. Why?

⇒That behavior probably comes from a live edge function. Restoring brings back the earlier code, but the live functions don't change until you ask the AI Agent to sync them.

Next steps