Git: Undo Commit

By Xah Lee. Date: . Last updated: .

How to undo commit?

git reset --soft HEAD^
reset to last commit, but keep your changes
git reset --hard HEAD^
reset to last commit, THROW AWAY ALL YOUR CHANGES

git FAQ