> ## Documentation Index
> Fetch the complete documentation index at: https://deployz.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Roll back a deployment

> Return a deployment to the release it ran before the current one.

Roll back when the current release causes problems and you want the customer's deployment back on the release it ran before. A rollback restores the previous release of your application. It doesn't touch the database or stored files.

> [!WARNING]
>
> Application rollback does not automatically reverse database migrations.
>
> A rollback never runs migrations, in either direction. If the current release changed the database schema, the previous release runs against the changed schema. Check that the previous release still works with it before you roll back. See [Keep migrations safe for rollback](https://deployz.dev/docs/prepare/migrations.md#keep-migrations-safe-for-rollback).

## What a rollback changes

| Changes | Stays the same |
| - | - |
| The release the application runs | The database and its data |
| Scheduled jobs (**Preview**) move to the restored release | Stored files |
| | The deployment's configuration, including customer overrides |
| | Infrastructure, Region, and size |

Rollback goes to the previous release only: the release that ran before the current one. You can't pick another release here. To move to any other release, older or newer, use [Deploy an update](https://deployz.dev/docs/operate/deploy-update.md).

## Roll back

**Who:** you (the vendor), in the Deployz dashboard.

1. In **Deployments**, open the customer's deployment.
2. Open the **More actions** menu (the three-dot button next to the actions), then select **Roll back to `<version>`**.
3. In **Roll back to `<version>`?**, check **Current release** and **Roll back to**.
4. Read the migration warning, then select **Roll back**.

The deployment changes to **Updating**, and the detail page shows **Rolling back**. The current release keeps serving while the previous one is restored. When the connector confirms the restored release is healthy, **Recent activity** shows **Rolled back**.

If the rollback fails, the detail page shows **Rollback failed**, and the release that was running stays live. See [Find your problem](https://deployz.dev/docs/troubleshooting/overview.md).

To roll back from a script, see [Restart or roll back](https://deployz.dev/docs/api/pipeline.md#restart-or-roll-back) in the API guide.

## When rollback is unavailable

**Roll back** is unavailable in the **More actions** menu when:

* **No previous successful release to roll back to.** The deployment has run only one release.
* **The previous release is already running.** For example, you already rolled back after a failed update.
* The deployment can't take actions right now: it isn't installed, the connector is offline, or another operation is running. The detail page shows the reason. The rules are the same as in [When an update is unavailable](https://deployz.dev/docs/operate/deploy-update.md#when-an-update-is-unavailable).

Deployz also refuses a rollback when the previous release no longer has a container image to deploy. The dialog then shows the reason. To move the deployment to a release that built successfully, use [Deploy an update](https://deployz.dev/docs/operate/deploy-update.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.