git - 撤消 git add --all

标签 git git-add

<分区>

我犯了一个错误,调用了 git add -all,现在所有的文件都被添加了。我没有进行 commitpush。我怎样才能撤消我的操作?

最佳答案

已经回答了好几次了:

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/

相关文章:

Git递归添加单个子目录

git - 如何在 git 中重新添加添加的文件(仅更新暂存文件)?

git - 如何在git中递归添加特定文件?

git - 修改我从中 fork 的 Github 存储库

git - 如何使用 gitweb 确定子模块 SHA-1?

Git 不会添加修改过的文件

git - 恢复已添加到索引但随后被 git reset 删除的文件

git - git 中与 repo 关联的文件,在版本控制下,但不与任何特定分支关联?

git - HEAD~1, fatal : invalid upstream 'HEAD~1' . .. 我做错了什么?

Git Push - 远程 url 中的用户名和密码