Mercurial:删除后如何恢复部分工作副本
我在解决方案中删除了一个项目,提交了多次,现在发现我仍然需要那个已删除的项目。有没有办法在保留历史记录的情况下恢复它?
I deleted a project in my solution, committed many times and now found out that I still need that deleted project. Is there a way to restore it with keeping it's history?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设删除的内容实际上在存储库中跟踪:
通过这样做,您只是告诉 Mercurial 恢复这些文件,就像您删除它们时一样。不会恢复其他文件,只需注意正确指定其以前的位置即可。只要回顾一下你的历史,你就会发现这一点。
从
hg --help revert
的输出:供参考(选项)[-r 是您想要的]:
Assuming what was deleted was actually tracked in the repository:
By doing this, you are simply telling mercurial to bring back those files, as they were when you deleted them. No other files will be reverted, just take care to specify their previous locations correctly. You can find that just going through your history.
From the output of
hg --help revert
:And for reference (the options) [-r is what you want here]: