Git · History and recovery

git reset --soft

Moves the branch back while keeping changes staged, ideal for re-splitting a commit.

Syntax
git reset --soft HEAD~1

Example

Example
git reset --soft HEAD~1
git status

More in this group

git clean git reflog git reset --hard git reset --mixed 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