取消Git add -A命令

3

我错误地运行了该命令

git add -A

然后(当我弄清楚)时,我使用

停止了它。

Ctrl+C

有没有一种方法可以将存储库重置到git add -A之前的状态? git status显示:
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Changed but not updated:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    1xx_xx/xx.m~
#   modified:   2xx_xx/xx_xx.m
#   deleted:    3xx_xx/xx_xx.m~
#   modified:   4xx_xx/xx_xx.m
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   xx_xxvariables_ldac/
#   xx_xx/variables_ldac_template/
no changes added to commit (use "git add" and/or "git commit -a")

现在 git status 显示了什么? - Vishwanath
1
git reset --mixed。更多信息请参见http://git-scm.com/docs/git-reset。 - Vishwanath
git status非常慢...它什么也不显示 - gabboshow
我已经编辑了问题,并附上了git status的输出... xx_xx是为了保护隐私。 - gabboshow
好像索引中没有任何内容。所以你已经到了想去的地方... - Vishwanath
1个回答

5

运行git reset --mixed将重置索引,这听起来是您的目标。

重置索引但不重置工作树(即,更改的文件被保留但未标记为提交),并报告未更新的内容。这是默认操作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接