git reset command All In One
git reset
git reset --soft
&git reset --hard
# 软重置 commit
$ git reset --soft HEAD^
# 硬重置 commit
$ git reset --hard HEAD^
# HEAD^^ === HEAD~2
$ git reset --hard HEAD^^
# 等价于
$ git reset --hard HEAD~2
demos
HEAD^
vs HEAD~1
HEAD^^
===HEAD~2
https://git-scm.com/docs/git-reset#Documentation/git-reset.txt-Undoacommitmakingitatopicbranch
https://git-scm.com/docs/git-reset#Documentation/git-reset.txt-Undocommitspermanently
HEAD^
===HEAD~1
https://devconnected.com/how-to-git-reset-to-head/
https://www.runoob.com/git/git-reset.html