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

# Rollbacks & promotions

> Revert to a previous deployment or promote a specific version to production with zero downtime. Manage rollbacks and promotions in Unkey.

<Info>
  Unkey Deploy is in public beta. To try it, open the product switcher in the
  top-left of the dashboard and select **Deploy**. During beta, deployed
  resources are free. We're eager for feedback, so let us know what you think
  on [Discord](https://unkey.com/discord), [X](https://x.com/unkeydev), or
  email [support@unkey.com](mailto:support@unkey.com).
</Info>

When a deployment causes issues, you can roll back to a previous version instantly. Rollbacks switch traffic atomically, so there's no downtime during the transition.

## Roll back a deployment

1. Open your project's **Deployments** tab.
2. Click the three-dot menu on the deployment you want to revert to.
3. Select **Rollback**.

<Frame caption="Deployment context menu with rollback, promote, and redeploy options">
  <img src="https://mintcdn.com/unkey/x4OlsjqEyio8akfR/build-and-deploy/rollback-menu-light.png?fit=max&auto=format&n=x4OlsjqEyio8akfR&q=85&s=225bbad19825882cef1fc4952e94fbf4" alt="Deployment context menu" className="block dark:hidden" width="988" height="710" data-path="build-and-deploy/rollback-menu-light.png" />

  <img src="https://mintcdn.com/unkey/x4OlsjqEyio8akfR/build-and-deploy/rollback-menu-dark.png?fit=max&auto=format&n=x4OlsjqEyio8akfR&q=85&s=c564ecc39262332075b865df18076e95" alt="Deployment context menu" className="hidden dark:block" width="988" height="710" data-path="build-and-deploy/rollback-menu-dark.png" />
</Frame>

4. Review the current deployment, affected domains, and target deployment in the confirmation dialog.
5. Click **Rollback to target version**.

<Frame caption="Rollback confirmation showing current and target deployments">
  <img src="https://mintcdn.com/unkey/x4OlsjqEyio8akfR/build-and-deploy/rollback-modal-light.png?fit=max&auto=format&n=x4OlsjqEyio8akfR&q=85&s=d5c543e651523dda2811e1c46aaa0852" alt="Rollback confirmation dialog" className="block dark:hidden" width="1302" height="1398" data-path="build-and-deploy/rollback-modal-light.png" />

  <img src="https://mintcdn.com/unkey/x4OlsjqEyio8akfR/build-and-deploy/rollback-modal-dark.png?fit=max&auto=format&n=x4OlsjqEyio8akfR&q=85&s=9edd3ce08d5b2a97bfecefa2e2f92e57" alt="Rollback confirmation dialog" className="hidden dark:block" width="1302" height="1398" data-path="build-and-deploy/rollback-modal-dark.png" />
</Frame>

Unkey reassigns the environment and branch domains to point to the target deployment immediately. The previous deployment stays running until routes are fully switched, so no requests are dropped.

## What happens after a rollback

After a rollback, the affected environment enters a rolled-back state. This only applies to the environment where you triggered the rollback (for example, production). Other environments are unaffected.

In a rolled-back environment:

* The target deployment is serving traffic.
* New pushes to the branch still create deployments, but domains don't get reassigned to them automatically.
* The dashboard indicates that the environment is running a rolled-back version.

This prevents a new push from undoing your rollback. You stay on the rolled-back version until you explicitly promote a deployment.

## Promote a deployment

Promoting a deployment reassigns domains to point to it and restores normal behavior. After promoting, the next successful deployment from a push automatically receives traffic again.

1. Open your project's **Deployments** tab.
2. Click the three-dot menu on the deployment you want to promote.
3. Select **Promote**.

## Rolling forward vs rolling back

| Approach         | When to use                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| **Roll back**    | The issue is urgent and you need to restore service immediately              |
| **Roll forward** | The fix is quick, and you'd rather push a new deployment with the correction |

Rolling back is faster since it reuses an existing, known-good deployment. Rolling forward (pushing a fix) creates a new deployment and goes through the full build and deploy pipeline.

<Tip>
  In production, previous deployments stay running for 30 minutes after a new version goes live, then spin down. In preview environments, deployments stay running until they've been idle (zero requests) for six hours. Rolling back to a running deployment is instant. Rolling back to a spun-down deployment is still possible, but takes longer because the containers need to start up again. See [instant rollbacks](/build-and-deploy/deployments#instant-rollbacks) for details.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Deployment lifecycle" icon="arrows-spin" href="/build-and-deploy/deployments">
    How deployments progress from build to serving traffic
  </Card>

  <Card title="Builds" icon="hammer" href="/builds/overview">
    How Unkey builds your container images
  </Card>
</CardGroup>
