Git · History and recovery

git reset --mixed

Moves the branch back and unstages changes, leaving the working tree intact.

Syntax
git reset HEAD~1

Example

Example
git reset HEAD~1

More in this group

git clean git reflog git reset --hard git reset --soft git restore git revert git stash git stash apply vs pop

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course