rollback-rewrites
Restore history from before supported Git Wrangler rewrites.
git-wrangler rollback-rewrites [options]Warning: Rollback changes local history again. Review the preview and coordinate any force push with collaborators.
Quick start
git-wrangler rollback-rewrites
What it does
rollback-rewrites restores commits changed by rewrite-authors, rewrite-coauthors, rewrite-commits, rewrite-dates, and rewrite-hours to their original recorded state.
It previews affected local branches and asks once before restoring them. Commits created after the rewrite are kept where possible and reconnected to the restored history when needed.
Rollback is local-only and never contacts remotes. Repositories without a recovery point are skipped.
Before you run it
Working trees must be clean. Commit or stash current work first.
remove-secrets cannot be restored with this command. That operation deliberately clears earlier recovery data so deleted secrets cannot return.
Reconnecting newer commits may change their IDs and may invalidate commit signatures.
Options
| Option | Default | What it does |
|---|---|---|
--repo <path> |
Whole workspace | Restore exactly one repository. |
--yes, -y |
Off | Skip the rollback confirmation. |
--guided |
Off | Choose options through prompts. |
More examples
# Restore one repository
git-wrangler rollback-rewrites --repo ./api
After checking the restored history, use git-wrangler push --force when you need to publish it.
Related commands
- Read History rewriting safely for the complete rewrite and recovery flow.