Undo git add
This question already has an answer here:
It has already been answered several times:
You can use git reset
. This will 'unstage' all the files you've added after your last commit.
If you want to unstage only some files, use git reset -- <file 1> <file 2> <file n>
.
Also it's possible to unstage some of the changes in files by using git reset -p
.
See
要重置您可以使用的特定文件: git reset -- <file_a> <file_b>
或者重置所有更改,您可以使用git reset
。
上一篇: 如何在提交之前撤消git add
下一篇: 撤消git add