| name | rollback |
| description | Rolls back git commit, DB migration, or deploy to known-good with safety + health checks. Triggers: rollback, revert deploy, revert migration, rollback commit, git revert. |
| effort | medium |
| disable-model-invocation | true |
| argument-hint | [target: git/db/deploy] |
| allowed-tools | Bash, Read |
| hooks | {"PostToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"echo 'Reminder: verify rollback was successful and services are healthy'"}]}]} |
| scripts | ["scripts/rollback_info.py"] |
/rollback - Safe Rollback
$ARGUMENTS
What This Command Does
Safely revert changes with appropriate safety checks and confirmation.
Rollback Types
1. Git Rollback
git revert HEAD --no-edit
git revert <commit-sha> --no-edit
git reset --soft <commit-sha>
2. Database Migration Rollback
| Tool | Command |
|---|
| Alembic | alembic downgrade -1 |
| Prisma | npx prisma migrate resolve --rolled-back <name> |
| Laravel | php artisan migrate:rollback --step=1 |
| Django | python manage.py migrate <app> <previous> |
| Flyway | flyway undo |
3. Deployment Rollback
| Platform | Command |
|---|
| Kubernetes | kubectl rollout undo deployment/<name> |
| Docker Compose | docker compose up -d --force-recreate (with previous image tag) |
| Heroku | heroku rollback |
Gather Rollback Context
Run the rollback info script to assess current state before rolling back:
python3 ${CLAUDE_SKILL_DIR}/scripts/rollback_info.py
Returns JSON with:
git{} - current/previous commit, branch, commits ahead, uncommitted changes
migrations{} - detected tool (alembic/prisma/laravel/django/drizzle), rollback command
docker{} - running services and image tags
Safety Checks (MANDATORY)
Before any rollback:
- Confirm what will be reverted (show diff/plan)
- Check for dependent changes that may break