How do you recover from a bad `git filter-repo` run on the shared repo?
IntermediateProductionRecovery and incident handling
Answer
Always run it on a fresh mirror clone and keep the untouched original, so recovery is just discarding the rewritten copy. If it was already pushed, the original history exists in the backup mirror, and git push --force of the original refs restores it.
More on Recovery and incident handling
Someone force-pushed over main and 12 commits vanished. How do you recover?IntermediateAfter recovery, what do you change so a force-push to main cannot happen again?AdvancedA bad migration commit was deployed. Walk through your response in the first 15 minutes.IntermediateHow do you recover a deleted repository or branch on GitHub?IntermediateHow do you find who or what pushed a specific commit to a protected branch?AdvancedCI is red on main after a merge. What is your policy?Intermediate