To undo all your work since the last commit.

git reset --hard HEAD
git clean f

git reset HEAD

• Leaves the working directory alone

• The staged version matches HEAD


 

git reset HEAD~1


Make a inverse version of some changes

git revert <commit-id>