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

you might want to unadd too. see Git: Undo Add File

git reset --hard HEAD^

reset to last commit, THROW AWAY ALL YOUR CHANGES

git add, commit

git FAQ