I started messing around with git filter-branch
. The --all option rewrites all branches and tags. Cool. git filter-branch
creates a backup of all refs it overwrites in refs/original. Very Cool. Now I'd like to blow all my experimenting with filter-branch
away.
Is there an easy way to completely undo the effects of git filter-branch <whatever filter> -- --all
? I.e. to restore all of the rewritten branches to their original state all at once?
If there isn't a preexisting way, there should be. If there isn't a preexisting way, does anybody have a short script that will do it?
Obviously there's workarounds. I could restore it manually, a branch at a time, as in this question. Or I could just nuke and re-clone. Either would get tedious quickly in a repo with many branches/tags that is (say) being split up into smaller repos.