I have to wonder why unstage isn’t defined as unstage = reset HEAD. That would save keystrokes and would mean you could just type git unstage FILE.txt. Is there a situation where you want to unstage to something other than HEAD?
unstage
unstage = reset HEAD
git unstage FILE.txt
HEAD
HEAD is actually the default <tree-ish>/<commit> argument, so git reset FILE.txt and git reset HEAD FILE.txt should produce the same results.
<tree-ish>/<commit>
git reset FILE.txt
git reset HEAD FILE.txt
To your question, there might be a situation in which one might want to unstage something other than HEAD, but I’ve never encountered it.
(misclick, sorry)
I have to wonder why
unstage
isn’t defined asunstage = reset HEAD
. That would save keystrokes and would mean you could just typegit unstage FILE.txt
. Is there a situation where you want to unstage to something other thanHEAD
?HEAD
is actually the default<tree-ish>/<commit>
argument, sogit reset FILE.txt
andgit reset HEAD FILE.txt
should produce the same results.To your question, there might be a situation in which one might want to unstage something other than
HEAD
, but I’ve never encountered it.(misclick, sorry)