Sep 7, 2018 · 1 min read
Shouldn't it be like this? Without --filename when its not for a specific file?
### Switch to the version of the code before the most recent commit
git reset HEAD^
git reset HEAD^ -- filename # for a specific file### Switch back 3 or 5 commits
git reset HEAD~3
git reset HEAD~3 -- filename # for a specific file
git reset HEAD~5
git reset HEAD~5 -- filename # for a specific file### Switch back to a specific commit
### Where the '0766c053' is the commit ID
git reset 0766c053
git reset 0766c053 -- filename # for a specific file
