For me git reset --soft HEAD 1, I have a git alias for this git undo. This is particularly useful for me when I want to fix small mistakes in committed files, without adding a new commit.
Also, git reflog. Very useful to get info about commits from deleted branches.
HEAD~1, you missed the tilde. Also, --soft and 1 are the defaults, and @ can be used as a shorthand for HEAD when it's part of a relative graph distance expression, so it's simply
git reset @~
undo is still shorter : )
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For me
git reset --soft HEAD 1
, I have a git alias for thisgit undo
. This is particularly useful for me when I want to fix small mistakes in committed files, without adding a new commit.Also,
git reflog
. Very useful to get info about commits from deleted branches.HEAD~1
, you missed the tilde. Also,--soft
and1
are the defaults, and@
can be used as a shorthand forHEAD
when it's part of a relative graph distance expression, so it's simplyundo
is still shorter : )