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

# Rollbacks

> Make an earlier deployment live again in seconds, without a rebuild. How long builds are kept, and how rollback differs from redeploy.

A rollback makes an earlier deployment live again. Pxxl doesn't rebuild anything: it starts the exact build that ran before, from the copy it stored when that deployment went live. So a rollback is fast, and you get back precisely what was running, even if a dependency has changed since.

Rollbacks are on Plus, Pro and Enterprise.

## Roll back from the dashboard

**1. Open Deployments**

Open the project and select the **Deployments** tab.

**2. Pick the deployment**

Find the last deployment that worked. Open the **⋯** menu on its row and choose **Rollback**.

![The row menu of a deployment in the Deployments tab, with View logs, View repo, Rebuild same commit, Rollback, Cancel deployment and Copy deployment ID.](https://mintcdn.com/pxxl/ypVoJksmlLGl2UHR/images/deploy/project-deployments-menu.jpeg?fit=max\&auto=format\&n=ypVoJksmlLGl2UHR\&q=85\&s=952b28d3a2085a0351ef82946aa8f9de)

**3. Watch it go live**

The rollback shows as a new deployment. It starts the old build, passes the [health check](https://docs.pxxl.app/deploy/builds.md#health-checks), and traffic switches over with no downtime, like any deployment.

## Roll back from the CLI

```bash theme={null}
pxxl ls                    # list this project's deployments
pxxl rollback              # pick one, or the latest good one in CI
pxxl rollback <deployment-id>
```

Without an id, the CLI asks which deployment to make live. When it can't ask (in CI, or with `--yes`), it picks the most recent good deployment before the current one. See [CLI commands](https://docs.pxxl.app/cli/commands.md#deploy).

## What a rollback brings back

| Comes back | Doesn't change |
| - | - |
| The code and the built output of that deployment, including any variables that were built into it, such as `VITE_*` or `NEXT_PUBLIC_*` values in a static site. | Your databases and volumes. Data written since stays. |
| Its routing rules from `pxxl.toml`, and its microfrontend paths. | Your project settings, domains and plan. |
| Its Functions. | The variables stored in the **Secrets** tab. |

* The [pre-deploy command](https://docs.pxxl.app/deploy/builds.md#pre-deploy-command) doesn't run again, so a rollback never re-runs migrations. If the newer deployment changed your database schema, check the old code still works with it.
* To undo a change to your variables too, use the variables' **History** in the **Secrets** tab. See [History and rollback](https://docs.pxxl.app/deploy/environment-variables.md#history-and-rollback).

## How far back you can go

Pxxl keeps each deployment's build for a while after it's replaced:

| | Free | Plus | Pro | Enterprise |
| - | - | - | - | - |
| Rollback | No | Yes | Yes | Yes |
| Builds kept for | 24 hours | 30 days | 60 days | 60 days |

Once a build has expired, its **Rollback** is no longer available. To go back further, use **Rebuild same commit**, which builds that commit again.

Only one rollback can run at a time in a project.

## Rollback, rebuild or redeploy?

| | What it does | Builds again? | Plans |
| - | - | - | - |
| **Rollback** | Makes an earlier build live again. | No, it reuses the stored build. | Plus and up |
| **Rebuild same commit** | Builds that deployment's commit again, with today's settings and variables. | Yes | All |
| **Redeploy** | Builds the latest commit again, or one you pick with **Deploy a specific commit**. Turn off **Use build cache** for a clean build. | Yes | All |

On GitHub, you can also roll back by reverting the bad commit and pushing. That keeps your Git history and production in step, but it takes a full build.

## Stop auto-deploy after a rollback

A rollback doesn't stop deploys on push. The next push to your branch deploys as normal, so if the bad commit is still on the branch, fix or revert it first. To hold production where it is while you fix it, choose **Pause Auto Deployments** in the project header menu, or turn off **Settings > Deployments > Auto-deploy**.


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