Overview
Rollbacks allow you to quickly revert to a previous stable version of your Worker. When issues arise in production, rollback provides a fast recovery path.Quick Rollback
Roll back to the most recent stable deployment:Rollback to Specific Version
Roll back to a specific version by ID:With Custom Message
Interactive Rollback Process
When you run a rollback command, you’ll see:1
Current deployment
View the currently active deployment:
2
Rollback target
The system identifies the rollback version:
3
Confirmation
Confirm the rollback:
4
Complete
Rollback completes:
Automatic Rollback Target
When no version is specified, the rollback command finds the default target:- Fetches recent deployments
- Sorts by creation date (newest first)
- Skips the current deployment
- Finds the first deployment at 100% traffic
Rollback with Secret Changes
If secrets have changed since the target version was deployed, you’ll see an additional confirmation:Secret Rollback Behavior
When secrets have changed:Rollback Scope
What Gets Rolled Back
✅ Included in rollback:- Worker code
- Compatibility settings
- Binding configurations
- Environment variables
- Secret values (current values persist)
- Bound resources (KV data, R2 objects, D1 tables)
- Durable Object state
- Routes and triggers
- Custom domains
Resource Data Persistence
For example:- If your new version wrote data to KV, that data remains after rollback
- If your new version created D1 tables, those tables persist
- Durable Object instances maintain their state
Legacy Rollback (Deployments)
For non-versioned Workers, use the legacy rollback command:Legacy Rollback Process
The legacy system works with deployments instead of versions:Non-Interactive Rollback
Skip confirmations in CI/CD:--yes flag:
- Accepts all confirmations automatically
- Useful for automated deployments
- Still validates the rollback target
Rollback Annotations
Rollbacks create a new deployment with special annotations:- The deployment was a rollback
- Which version was rolled back from
- Why the rollback occurred
Rollback Best Practices
- Monitor Deployments - Watch metrics to detect issues early
- Keep Stable Versions - Maintain known-good versions for rollback
- Document Rollbacks - Use
--messageto explain why - Test After Rollback - Verify the rollback resolved the issue
- Plan Forward - Fix issues and deploy forward, don’t stay on old versions
Rollback vs. Deploy Previous Version
Two ways to revert:Option 1: Rollback Command
- ✅ Automatic target selection
- ✅ Built-in confirmations
- ✅ Rollback annotations
- ❌ Only deploys to 100%
Option 2: Manual Deploy
- ✅ More control over process
- ✅ Can split traffic if desired
- ❌ Manual version selection
- ❌ No rollback annotations
Troubleshooting
”No stable version found”
If all recent deployments used traffic splitting:“Less than 2 deployments”
For new Workers:Secret Changes Blocking Rollback
If you don’t want to confirm secret changes: Solution: Update secrets first, then rollback:Next Steps
Deploying
Learn about deployment strategies
Version Management
View and manage versions
Secrets
Manage Worker secrets