<分区>
我犯了一个错误,调用了 git add -all
,现在所有的文件都被添加了。我没有进行 commit
和 push
。我怎样才能撤消我的操作?
<分区>
我犯了一个错误,调用了 git add -all
,现在所有的文件都被添加了。我没有进行 commit
和 push
。我怎样才能撤消我的操作?
最佳答案
已经回答了好几次了:
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
.
见
关于git - 撤消 git add --all,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28011104/