【发布时间】:2010-12-07 05:39:46
【问题描述】:
从命令行看到以下内容后:
# 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(从上次提交的状态签出,而不是从索引中签出)是否有效? -
git checkout HEAD -- index.htm为我工作!