---
title: "Roll back to the previous version in 2026: one second, by your AI"
url: https://while.sh/en/guides/rollback/
author: "Aloïs Oddon, co-founder of Nextmap"
updated: 2026-11-19
---

# Roll back to the previous version in one second, with your AI (2026)

A new version breaks your app: ask your AI to roll back, and the previous version takes the traffic again in a second. Then your AI reads the error, fixes it and deploys again.

> **The short version.** Did a deployment break your app? Your AI brings back the previous version in a second, reads the error in the logs, fixes it and deploys again. What matters, like deleting a database, waits for a person's approval.

## Prerequisites

- An app deployed on while.
- Your AI, connected to while over MCP.

## Step 1: Ask for the rollback

> You, to your AI: Go back to the previous version.

In the 30 minutes after a production release, the previous version takes the traffic again in a second. After that, it takes a few seconds.

## Step 2: The fixed version follows

Your AI reads the error and the logs in while, fixes the problem and deploys the fixed version.

## What your AI does

Every version is frozen, and the previous one stays ready for 30 minutes after a deployment: going back only switches the traffic back to it. A version that fails its health check, or whose error rate climbs, is withdrawn automatically, without waiting for you to ask. And a version whose tests fail is never deployed. Going back fast matters: it's one of DORA's four key metrics (source 1).


<figure class="illus"><img src="/illustrations/guide-fonction-garde-1200.webp" srcset="/illustrations/guide-fonction-garde-768.webp 768w, /illustrations/guide-fonction-garde-1200.webp 1200w" sizes="(min-width: 48rem) 46rem, 100vw" width="1536" height="1024" loading="lazy" decoding="async" alt="Rolling back to the previous version with while: credentials kept out of the AI's reach, every call logged in the history, a person's approval for what matters and a daily backup, in France" /><figcaption>Around every app, while keeps the credentials, the history, the approvals and the backups.</figcaption></figure>

## Go back to an older version

> You, to your AI: Go back to Monday's version.

Your AI lists the versions, with their dates, and deploys Monday's version again, in a few seconds.

## Understand what broke

> You, to your AI: Why is the new version crashing?

Your AI reads the error, the logs and the grouped errors in while, and finds the line responsible.

## Roll back the data too

> You, to your AI: Also restore the database to how it was before the migration.

The code and the database go back separately. Your AI restores the database to the moment before the migration, once you approve it in production.

## See a new version before you deploy it

> You, to your AI: Show me the new version before you deploy it.

Your AI opens a preview, at its own address, with its own data. You look at it, then your AI puts it into production.

## Next steps

- [Restore your database to a precise moment](/en/guides/restore-postgresql/)
- [Track errors with a Sentry SDK](/en/guides/track-errors-sentry/)
- [See every version before production](/en/guides/preview-environments/)

## Sources

1. [DORA, the four key metrics of software delivery](https://dora.dev/guides/dora-metrics/), 2026-11-02

## Questions

### Does a rollback touch my database?

No, it only changes the code. The database is restored separately, to a precise moment.

### Can a broken version stay live?

No. A version that fails its health check, or whose error rate climbs, is withdrawn automatically.

### What about an app that's asleep?

The previous version comes back right away, and its first request wakes it up.

### Where do my app and its data run?

In France, at Nextmap. The database is backed up every day, with a way back over 14 days, once a person approves.

### Does my AI see my credentials?

No. You paste them into while, the app uses them, and your AI never sees them. Every call is logged.
