在命令行中看到以下内容:
# On branch RB_3.0.10
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: index.htm
我试图通过输入以下命令来放弃我的更改:
git checkout -- index.htm
但是当我重新运行 git status 命令时,看起来完全相同。检出好像没有生效。我做错了什么吗?我在 windows/cygwin 上使用 GIT 1.6.1.2。
# On branch RB_3.0.10
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: index.htm
git checkout HEAD -- index.htm
(从最后一次提交的状态进行检出,而不是从索引中检出) 是否可行? - Jakub Narębski