2010-05-14 74 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