2010-05-14 72 views

回答

3

假设什么被删除竟是存储库中的跟踪

hg revert -r (last-revision-where-files-still-existed) path/to/files/that/were/deleted 

通过这样做,你只是告诉善变带回这些文件,因为他们当你删除它们。没有其他文件将被恢复,只要注意正确指定他们以前的位置。你可以发现,只是通过你的历史。

hg --help revert输出:

如果一个文件已被删除,这是 恢复。如果 文件的可执行模式已更改,则会重置。

以供参考(选项)-r是你想要的这里]:

options: 

-a --all  revert all changes when no arguments given 
-d --date  tipmost revision matching date 
-r --rev  revision to revert to 
    --no-backup do not save backup copies of files 
-I --include include names matching the given patterns 
-X --exclude exclude names matching the given patterns 
-n --dry-run do not perform actions, just print output 

use "hg -v help revert" to show global options