在命令行中看到以下内容之后:
# 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
(从最后提交的状态检查出来,而不是从指数退房)的作品?