假设删除的内容实际上是
跟踪的
在存储库中:
hg revert -r (last-revision-where-files-still-existed) path/to/files/that/were/deleted
通过这样做,您只需告诉Mercurial恢复这些文件,就像您删除它们时一样。不会还原其他文件,只需注意正确指定其以前的位置。你可以在历史中找到它。
从输出
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