取消git add -A

时间:2014-08-28 13:49:42

标签: git git-add

我错误地运行命令

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")

1 个答案:

答案 0 :(得分:3)

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

  

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