2
我在我的解决方案中删除了一个项目,多次提交,现在发现我仍然需要删除项目。有没有办法通过保留它的历史来恢复它?Mercurial:删除后如何恢复部分工作副本
我在我的解决方案中删除了一个项目,多次提交,现在发现我仍然需要删除项目。有没有办法通过保留它的历史来恢复它?Mercurial:删除后如何恢复部分工作副本
假设什么被删除竟是存储库中的跟踪:
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