Soft reset

A soft reset moves the branch HEAD points to (and thereby moves also HEAD). It effectively unrolls the last git commit command.

$ git log --oneline --decorate 
5a4e185 (HEAD, master) V3
bd670b5 V2
1532be9 V1

$ git reset --soft HEAD~

$ git log --oneline --decorate 
bd670b5 (HEAD, master) V2
1532be9 V1

$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   file.txt

HEAD         V2
INDEX        V3
Working tree V3

git reset –soft ... is used e.g. to squash the repo, see 7.0.5.