Mixed reset

A mixed reset moves the branch HEAD points to and updates the INDEX. It effectively unrolls the last git commit and the last git add command.

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

$ git reset --mixed HEAD~
Unstaged changes after reset:
M	file.txt

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

$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file.txt

HEAD         V2
INDEX        V2
Working tree V3

git reset –mixed ... is used, if you want to compare the files in the working tree with older commits.