Git: Undo Commit

By Xah Lee. Date: . Last updated: .

Reset to last commit, but keep your changes

# undo last commit, but keep your changes
git reset --soft HEAD^

# undo add
git reset .

Reset to last commit, throw away all your changes

git reset --hard HEAD^

git add, commit

git FAQ

Git manage