Git: Undo Commit

By Xah Lee. Date: .

How to undo commit?

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

git FAQ

git

git FAQ