I made a booboo in my project and would like to revert back to a previous commit. But I still would like to have my booboo files accessible for reference in the future. What should I do?
1 Answer
As long as your commits are reachable from a branch or tag, they'll never be garbage collected. The simplest thing would be to create a tag, e.g.
$ git tag mytag # optionally specify commit sha, default is HEAD
$ git reset --hard <new-sha>