且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何撤消git checkout文件中未提交的更改?

更新时间:2021-12-04 05:25:18

根据git的文档此处:

重要的是要了解 git checkout-< file> 是一个危险的命令.您对该文件所做的任何更改均已消失– Git刚刚复制了另一个文件.除非使用此命令,否则不要使用您完全知道您不需要该文件.

It’s important to understand that git checkout -- <file> is a dangerous command. Any changes you made to that file are gone – Git just copied another file over it. Don’t ever use this command unless you absolutely know that you don’t want the file.

所以您不能撤消该命令.

So you can't undo this command.