我错误地运行命令
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")
答案 0 :(得分:3)
运行git reset --mixed
会重置索引,这听起来像是你的目标。
重置索引但不重置工作树(即保留更改的文件但未标记为提交)并报告尚未更新的内容。这是默认操作。