I am using GitHub as my remote repository.
I have already pushed 5 commits to the server and want to revert back to the state before the those commits.
If the co
Do a git checkout, then commit it to the branch you want. This will make a new commit with the old code (so you'll have 6 commits).
git checkout HEAD~3
, where 3 is the number of commits back you want to revert to.
Better yet, you can checkout a single file into the present HEAD:
git checkout 3425661dba2aadccdbab:path/to/file/from/base
This will reduce the likelihood of making other people angry with you pulling the proverbial rug out from under their feet.
EDIT:
There's a similar question here:
Checkout old commit and make it a new commit