我是git的新手,正在学习和使用它。
我在git中添加了一些文件:
git add <file1>
git add <file2>
然后我想将其推送进行审核,但错误地执行了此操作。
git commit
所以我更改过的文件不会进行审核。
现在,如果我输入以下命令:
git status
它说:# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
我想撤销那次提交,并且我希望将这些文件推送进行查阅,而不是提交。
有人可以告诉我如何做吗?
git reset HEAD^
。 - Anonymoose