如何在提交前撤消'git add'? - How do I undo 'git add' before commit?

问题:

Want to improve this post? 想要改善这篇文章吗? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. 提供此问题的详细答案,包括引文和为何答案正确的解释。 Answers without enough detail may be edited or deleted. 答案不够详细的答案可能会被编辑或删除。 git

I mistakenly added files to Git using the command: 我错误地使用如下命令将文件添加到了Git: ide

git add myfile.txt

I have not yet run git commit . 我尚未运行git commit Is there a way to undo this, so these files won't be included in the commit? 有一种方法能够撤消此操做,以便这些文件不会包含在提交中? post


解决方案:

参考一: https://stackoom.com/question/1SZe/如何在提交前撤消-git-add
参考二: https://oldbug.net/q/1SZe/How-do-I-undo-git-add-before-commit
相关文章
相关标签/搜索