[英]How to undo removal of a file in svn
duplicate : What's a simple way to undelete a file in subversion? 复制 : 在subversion中取消删除文件的简单方法是什么?
What is the best way to undo removal of a file and keep the file history. 撤消删除文件并保留文件历史记录的最佳方法是什么。
I've removed a file by accident, and commited it along with other changes. 我偶然删除了一个文件,并将其与其他更改一起提交。
I can get an older revision of the file and add it to svn, but I think this approach will lose change history. 我可以获得该文件的旧版本并将其添加到svn,但我认为这种方法将失去更改历史记录。
How do I keep the history? 我如何保留历史?
I can get an older revision of the file and add it to svn, but I think this approach will lose change history 我可以获得该文件的旧版本并将其添加到svn,但我认为这种方法将失去更改历史记录
No, it won't. 不,它不会。 This is the right thing to do. 这是正确的做法。 The history will reflect the removal of the file, but also its addition in the subsequent revision. 历史记录将反映文件的删除,但也会在后续修订中添加。 This is what history is -- a record of what happened. 这就是历史 - 记录发生的事情。
If you remove a file using TortiseSVN's delete menu command or svn rm
, the history is still there. 如果使用TortiseSVN的删除菜单命令或svn rm
删除文件,则历史记录仍然存在。 It is not lost unless you mess with the repository more deeply than that. 除非你更深入地了解存储库,否则它不会丢失。
Revert that file to an earlier revision. 将该文件还原为早期版本。
In TortoiseSVN, the easiest way to do this via the Log window. 在TortoiseSVN中,通过Log窗口执行此操作的最简单方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.