For newer versions of Git there is git restore --staged <file>
.
When I do a git status
with Git version 2.26.2.windows.1
it is also recommended for unstaging:
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
(This post shows, that in earlier versions git reset HEAD
was recommended at this point)
I can highly recommend this post explaining the differences between git revert
, git restore
and git reset
and also additional parameters for git restore
.