---
title: Rolling back a production deployment
product: vercel
url: /docs/deployments/rollback-production-deployment
canonical_url: "https://vercel.com/docs/deployments/rollback-production-deployment"
last_updated: 2026-09-11
type: how-to
prerequisites:
  - /docs/deployments
related:
  - /docs/cli/project-linking
  - /docs/cli/rollback
  - /docs/cli/promote
  - /docs/cli/bisect
  - /docs/cli/inspect
summary: Recover from a bad production deployment by rolling back, investigating the root cause, and redeploying a fix.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest docs search "<query>"
---

# Rolling back a production deployment

Use this guide to recover from a bad production deployment. You'll roll back to restore service, investigate the root cause, and deploy a fix.


<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Performing a rolling release deployment](https://vercel.com/docs/rolling-releases/rolling-release-deployment) — Gradually roll out a production deployment using traffic stages, monitoring, and automated abort.
- [Deploying a project from the CLI](https://vercel.com/docs/projects/deploy-from-cli) — Set up and deploy a Vercel project using the CLI, from linking to production.
- [Deploying Projects from Vercel CLI](https://vercel.com/docs/cli/deploying-from-cli) — Learn how to deploy your Vercel Projects from Vercel CLI using the vercel or vercel deploy commands.
- [Managing Deployments](https://vercel.com/docs/deployments/managing-deployments) — Learn how to manage your current and previously deployed projects to Vercel through the dashboard. You can redeploy at a
- [Promoting a preview deployment to production](https://vercel.com/docs/deployments/promote-preview-to-production) — Test a preview deployment and promote it to production using the CLI.

Full cross-link map for this page: [/docs/deployments/rollback-production-deployment.graph.md](/docs/deployments/rollback-production-deployment.graph.md)
<!-- /docsgraph:related -->

> **💡 Note:** This guide requires a [linked Vercel project](/docs/cli/project-linking). Run `vercel link` in your
> project directory if you haven't already.

## Quick reference

Use this block when you already know what you're doing and want the full command sequence. Use the steps below for context and checks.

```bash filename="terminal"
# 1. Confirm the problem
vercel logs requests --environment production --query 'httpStatus >= 500 AND httpStatus < 600' --since 30m

# 2. Roll back immediately to restore service (pass the URL or ID to roll back to)
vercel rollback <previous-deployment-url-or-id>
vercel rollback status

# 3. Verify service is restored
vercel logs requests --environment production --query 'httpStatus >= 500 AND httpStatus < 600' --since 5m

# 4. Identify the bad deployment
vercel list --environment production
vercel inspect <bad-deployment-url>

# 5. Check build logs for clues
vercel inspect <bad-deployment-url> --logs

# 6. Compare error logs between good and bad deployments
vercel logs --deployment <bad-deployment-id> --query 'level:error'
vercel logs --deployment <good-deployment-id> --query 'level:error'

# IF the cause spans multiple deployments, binary-search with bisect:
vercel bisect --good <good-deployment-url> --bad <bad-deployment-url>
# OR automate bisect with a test script (exit 0 = good, non-zero = bad, 125 = skip):
vercel bisect --good <good-deployment-url> --bad <bad-deployment-url> --run ./test.sh

# 7. Fix and deploy a preview
vercel deploy
vercel curl /affected-route --deployment <preview-url>
vercel logs --deployment <preview-deployment-id> --query 'level:error'

# 8. Ship to production
vercel deploy --prod
vercel logs requests --environment production --query 'httpStatus >= 500 AND httpStatus < 600' --since 5m

# ALTERNATIVE to redeploying: promote an existing good deployment directly
vercel promote <deployment-url>
vercel promote status
```

> Install the [Vercel plugin](/docs/agent-resources/vercel-plugin?from=docs-callout\&source_path=%2Fdocs%2Fdeployments%2Frollback-production-deployment) to recover from a failed production deployment with your coding agent.
>
> ```bash
> npx plugins add vercel/vercel-plugin
> ```

## 1. Confirm the problem

Before rolling back, verify that the current production deployment is actually broken. Check for errors in production logs:

```bash filename="terminal"
vercel logs requests --environment production --query 'httpStatus >= 500 AND httpStatus < 600' --since 30m
```

If you're seeing a spike in errors or user reports, move to the next step.

## 2. Roll back immediately

When production is broken, restoring service is the priority. Roll back by pointing production at a previous deployment. Pass the URL or deployment ID you want to roll back to:

```bash filename="terminal"
vercel rollback <previous-deployment-url-or-id>
```

This points production traffic to the deployment you specify without rebuilding. The rollback happens at the routing layer, so it takes effect within seconds.

> **💡 Note:** On the Hobby plan, you can only roll back to the immediately previous
> production deployment. Pro and Enterprise plans can roll back to any previous
> production deployment by specifying the deployment URL.

To verify the rollback completed:

```bash filename="terminal"
vercel rollback status
```

## 3. Verify service is restored

Confirm that the rollback resolved the issue by checking production logs again:

```bash filename="terminal"
vercel logs requests --environment production --query 'httpStatus >= 500 AND httpStatus < 600' --since 5m
```

If the error count has dropped, service is restored and you can investigate at your own pace.

## 4. Identify the bad deployment

List recent production deployments to find the one that caused the issue:

```bash filename="terminal"
vercel list --environment production
```

This shows the age, URL, status, build duration, and creator of each production deployment. Identify the deployment that was serving traffic when the errors started.

To see full details about that deployment:

```bash filename="terminal"
vercel inspect <bad-deployment-url>
```

This shows the deployment ID, target environment, status, creation time, build duration, and other metadata.

## 5. Check the build logs

Sometimes the issue is visible in the build output. Check the build logs for warnings or errors that were missed:

```bash filename="terminal"
vercel inspect <bad-deployment-url> --logs
```

Look for deprecation warnings, missing environment variables, or build-time errors that didn't block the deployment but affected runtime behavior.

## 6. Compare with the last known good deployment

If the cause isn't obvious, compare error logs between the good and bad deployments:

```bash filename="terminal"
vercel logs --deployment <bad-deployment-id> --query 'level:error'
```

```bash filename="terminal"
vercel logs --deployment <good-deployment-id> --query 'level:error'
```

The difference in error patterns between the two deployments narrows down what changed.

## 7. Bisect if the cause spans multiple deployments

If several deployments went out between the last known good state and the broken one, use `vercel bisect` to binary-search through them:

```bash filename="terminal"
vercel bisect --good <good-deployment-url> --bad <bad-deployment-url>
```

This walks through deployments one at a time, letting you check each one and mark it as good or bad. It finds the exact deployment that introduced the regression.

To automate the bisect with a test script:

```bash filename="terminal"
vercel bisect --good <good-deployment-url> --bad <bad-deployment-url> --run ./test.sh
```

The script receives the deployment URL as an argument. Exit code 0 means good, non-zero means bad, and 125 means skip.

## 8. Fix and deploy

Once you've identified the root cause, make the fix locally and deploy a preview:

```bash filename="terminal"
vercel deploy
```

Verify the fix against the preview deployment:

```bash filename="terminal"
vercel curl /affected-route --deployment <preview-url>
```

Check that no errors appear in the preview logs:

```bash filename="terminal"
vercel logs --deployment <preview-deployment-id> --query 'level:error'
```

## 9. Ship to production

When the fix passes verification, deploy to production:

```bash filename="terminal"
vercel deploy --prod
```

Confirm the fix is working in production:

```bash filename="terminal"
vercel logs requests --environment production --query 'httpStatus >= 500 AND httpStatus < 600' --since 5m
```

## Rolling back to a specific deployment

If you're on the Pro or Enterprise plan and need to roll back to a specific older deployment rather than just the previous one:

```bash filename="terminal"
vercel rollback <deployment-url>
```

You can also use `vercel promote` to promote any existing deployment to production:

```bash filename="terminal"
vercel promote <deployment-url>
```

To check the promotion status:

```bash filename="terminal"
vercel promote status
```

## Related

- [vercel rollback](/docs/cli/rollback)
- [vercel promote](/docs/cli/promote)
- [vercel bisect](/docs/cli/bisect)
- [vercel inspect](/docs/cli/inspect)
- [Instant Rollback](/docs/instant-rollback)
- [Debugging production 500 errors](/docs/observability/debug-production-errors)

## Search the docs from your terminal

Search the Vercel docs and read pages as Markdown with the Vercel CLI. No login required.

```bash
# Find docs pages by keyword
npx vercel@latest docs search "environment variables"
npx vercel@latest docs search "function timeout"

# Print a docs page as Markdown, by path or URL
npx vercel@latest docs inspect <page>
```

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
