Skip to main content

How can I destroy my last Git commit and its changes?

01 Sep 2013 - git

git reset --hard ORIG_HEAD

Basically, ORIG_HEAD is short for the commit before your last commit. It’s automatically set by pull and merge (but not necessarily other git commands). It’s also equivalent to HEAD@{1} meaning the previous commit from head.

References