Rollbacks
Safely revert deployments to any previous version. Instant rollbacks, point-in-time recovery, and zero-downtime strategies.
Overview
Rollbacks are a critical safety net in your deployment workflow. .git provides multiple rollback strategies to handle any scenario — from a quick undo of a bad deployment to a precise point-in-time recovery of your entire application state.
Every deployment is automatically versioned and stored, allowing you to revert to any previous deployment within your retention window (configurable per environment).
Best practice: Always configure automatic rollback triggers for your production environment. Combine health checks with automated rollbacks to minimize downtime.
Rollback Strategies
.git supports four rollback strategies. Choose the one that best fits your deployment model and risk tolerance.
Instant Rollback
Revert to the previous deployment in under 1 second. Traffic is instantly redirected without rebuilding.
Sub-secondPoint-in-Time
Restore your application to any specific timestamp. Includes database migrations and file state.
PreciseCanary Revert
Automatically roll back canary deployments when error thresholds are exceeded during gradual rollout.
Auto-triggeredBlue/Green Swap
Instantly swap traffic back to the previous environment. Zero downtime with full isolation.
Zero DowntimeUsing the CLI
Perform rollbacks directly from the command line using the git rollback command.
Rollback from the Dashboard
You can also trigger rollbacks from the Deployments page in your dashboard:
Navigate to Deployments
Go to your project dashboard and select the Deployments tab. View the deployment history timeline.
Select a Target Deployment
Click on any previous deployment to view its details. A Rollback to This Version button appears in the action bar.
Confirm & Execute
Review the rollback summary — including affected services, migration changes, and estimated downtime. Confirm to execute.
Instant feedback: After confirming, you'll see real-time progress in the dashboard and terminal. Most rollbacks complete in under 5 seconds.
Automatic Rollbacks
Configure automatic rollbacks to trigger when health checks fail or error rates exceed defined thresholds.
Migration safety: If migration_guard is enabled, automatic rollbacks will be blocked when the target deployment includes irreversible database migrations. You'll need to approve manually.
API Reference
Trigger and manage rollbacks programmatically using the REST API.
Strategy Comparison
| Feature | Instant | Point-in-Time | Canary | Blue/Green |
|---|---|---|---|---|
| Speed | < 1s | 10–30s | Auto | < 1s |
| Downtime | ✓ None | ~2–5s | ✓ None | ✓ None |
| DB Migration Revert | ✗ | ✓ | ✗ | ✗ |
| File State Restore | ✓ | ✓ | ✗ | ✓ |
| Auto-trigger Support | ✓ | ✗ | ✓ | ✓ |
| Best For | Quick fixes | Full recovery | Gradual rollouts | Zero-downtime ops |
Best Practices
- Test rollbacks in staging first. Run rollback simulations in your staging environment to verify the process works as expected.
- Set up health check rollbacks. Configure automatic rollbacks based on health check failures to catch issues before they impact users.
- Use rollback dry runs. Always preview a rollback with --dry-run to understand what will change before executing.
- Document rollback procedures. Keep runbooks updated with rollback steps specific to your project architecture.
- Monitor rollback frequency. High rollback rates may indicate deeper issues in your CI/CD pipeline or testing coverage.
- Set appropriate retention windows. Ensure you keep enough deployment history for your recovery needs (default: 90 days for production).
Irreversible migrations: Database migrations that destroy data (e.g., DROP TABLE, DROP COLUMN) cannot be safely reverted. Always backup before deploying migrations that may require rollback.
Monitoring Rollbacks
Track rollback events in real-time through the Observability Dashboard and set up alerts for rollback events:
Retention & Limits
Deployment versions are retained based on your plan and environment configuration:
| Plan | Staging Retention | Production Retention | Max Deployments Stored |
|---|---|---|---|
| Starter | 30 days | 30 days | 50 |
| Pro | 90 days | 90 days | 500 |
| Enterprise | 180 days | Unlimited | Unlimited |
Frequently Asked Questions
Ready to deploy with confidence?
Start using .git rollbacks today. Every plan includes instant rollback support.