Just use git reset
without the --hard
flag:
git reset HEAD~1
PS: On Unix based systems you can use HEAD^
which is equal to HEAD~1
. On Windows HEAD^
will not work because ^
signals a line continuation. So your command prompt will just ask you More?
.