Friday, March 22, 2019

Git revert commands

# It also takes ranges. This will revert the last two commits:
git revert HEAD~2..HEAD
# It also takes ranges. This will revert the last three commits:
git revert HEAD~3..HEAD
git revert --no-commit 0766c053..HEAD
git commit
This will revert everything from the HEAD back to the commit hash 0766c053

HEAD means the current version. 

More from this link: https://stackoverflow.com/questions/4114095/how-to-revert-a-git-repository-to-a-previous-commit