- 如果不是第一次提交,撤销提交命令
git reset HEAD^
- 如果是第一次提交,撤销操作命令是
git update-ref -d HEAD
如果还是使用git reset命令,那么会报下面的错误
fatal: ambiguous argument ‘HEAD^’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’