【发布时间】:2014-05-23 10:55:44
【问题描述】:
当你在 git 下修改一些文件时,使用git status,会出现以下消息:
On branch dev
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: script.php
所以我通常按照建议使用git checkout -- script.php 撤消我的编辑。
无论如何,我从一位同事那里发现,git checkout script.php 似乎实现了相同的结果。
所以,我的问题是:git checkout -- script.php 和 git checkout script.php 是同义词吗?
请至少提供一些文档的链接,以证明您所说的。谢谢!
【问题讨论】:
标签: git