0

I used git filter-branch and screwed something up and accidentally rewrote sections of the history I didn't want to. I was trying to change one name and accidentally changed every single commit (instead of only ones with a specific name).

I know that 'git filter-branch' keeps a backup at refs/original, but I don't know how to revert the master branch to this old version. What's the git command to do this?

4

1 回答 1

5

如果您知道要恢复到的提交 ID,则可以使用

$ git checkout master
$ git reset --hard <commit id>
于 2012-04-23T18:18:05.607 回答