← Back to all fixes
Need to rollback but no previous version available
The Issue
Production deploy broke. You try to rollback but the previous image was tagged `latest` and is gone.
Root Cause
Using mutable tags like `latest` means every push overwrites the previous image. You cannot go back.
How to Fix
Always tag images with immutable identifiers: git commit SHA (`myapp:abc1234`) or semver (`myapp:1.4.2`)Keep at least the last 5 image versions in your registryStore the deployed image tag in your CD pipeline output or deployment recordRollback command: `kubectl set image deployment/myapp myapp=myapp:abc1233` (previous SHA)Automate rollback: if smoke test fails post-deploy, re-deploy the previous tag automatically