All cards

Card #037 · Undo

Undoing the last commit

#037: Undoing the last commit. git reset HEAD^. git reset: command that resets to previous state. HEAD^: pointer that stores the current state. The circumflex is a shortcut for the last commit.

You might also be interested in reading this article:

Undoing the last commits using git reset