Undo git filter-branch

When you use git filter-branch, a backup file is created in

refs/original/refs/heads/master

If you used the command in branch master. You can check if you have the backup in .git/refs directory. With this in mind, you can use this backup to recover your files with:

git reset --hard refs/original/refs/heads/master

Leave a Comment