如何在TortoiseSVN中找回已删除的文件?

时间:2023-01-26 16:26:20

We had a file in our repository that we deleted several revisions ago. How do we get it back using TortoiseSVN without reverting our entire repository?

我们的存储库中有一个文件,我们之前删除了几个修订版。我们如何在不恢复整个存储库的情况下使用TortoiseSVN将其恢复?

5 个解决方案

#1


Go to the Show Log screen, and search for the revision when the file was deleted, then right click the file and select Save revision to...

转到“显示日志”屏幕,并在删除文件时搜索修订,然后右键单击该文件并选择“将修订保存到...”

如何在TortoiseSVN中找回已删除的文件?

#2


The other answers appear to focus on restoring an entire revision (using a different location), so here's how to only restore a single file, without having to check out an entire revision, using TortoiseSVN:

其他答案似乎侧重于恢复整个修订版(使用不同的位置),所以这里是如何只使用TortoiseSVN恢复单个文件而不必检查整个修订版:

  1. Open the revision log for the revision that deleted the file.
  2. 打开删除文件的修订的修订日志。

  3. Find the file in the changelist.
  4. 在更改列表中找到该文件。

  5. Right-click the file and select "Revert changes from this revision...". Answer yes.
  6. 右键单击该文件,然后选择“还原此修订版本中的更改...”。回答是的。

The file is restored and re-added to the repository. I am not 100% certain if Subversion will treat it as a different file, or as a new revision of the file.

该文件已还原并重新添加到存储库。如果Subversion将其视为不同的文件或文件的新版本,我不是百分之百确定。

#3


In the repo browser, there is a menu that says some to the effect of goto version. From here you can browse the field that was available in that revision and drag and drop the file out. i would check the actual program bur I'm currently on my phone.

在repo浏览器中,有一个菜单说明了goto版本的效果。从这里,您可以浏览该修订版中可用的字段并将文件拖放出去。我会查看我目前在手机上的实际程序。

Hope this helps

希望这可以帮助

#4


Once you know the revision number where the file was deleted (using the repository browser is probably the easiest way to find this). Do a check out to a new location before that revision.

一旦知道文件被删除的修订号(使用存储库浏览器可能是找到它的最简单方法)。在该修订之前检查一个新的位置。

#5


use revert option or open cmd window and type : (give the local path where you've checkout your code) svn -r (type revision no. before deleting that path)

使用revert选项或打开cmd窗口并键入:(给出检查代码的本地路径)svn -r(在删除该路径之前输入版本号)

#1


Go to the Show Log screen, and search for the revision when the file was deleted, then right click the file and select Save revision to...

转到“显示日志”屏幕,并在删除文件时搜索修订,然后右键单击该文件并选择“将修订保存到...”

如何在TortoiseSVN中找回已删除的文件?

#2


The other answers appear to focus on restoring an entire revision (using a different location), so here's how to only restore a single file, without having to check out an entire revision, using TortoiseSVN:

其他答案似乎侧重于恢复整个修订版(使用不同的位置),所以这里是如何只使用TortoiseSVN恢复单个文件而不必检查整个修订版:

  1. Open the revision log for the revision that deleted the file.
  2. 打开删除文件的修订的修订日志。

  3. Find the file in the changelist.
  4. 在更改列表中找到该文件。

  5. Right-click the file and select "Revert changes from this revision...". Answer yes.
  6. 右键单击该文件,然后选择“还原此修订版本中的更改...”。回答是的。

The file is restored and re-added to the repository. I am not 100% certain if Subversion will treat it as a different file, or as a new revision of the file.

该文件已还原并重新添加到存储库。如果Subversion将其视为不同的文件或文件的新版本,我不是百分之百确定。

#3


In the repo browser, there is a menu that says some to the effect of goto version. From here you can browse the field that was available in that revision and drag and drop the file out. i would check the actual program bur I'm currently on my phone.

在repo浏览器中,有一个菜单说明了goto版本的效果。从这里,您可以浏览该修订版中可用的字段并将文件拖放出去。我会查看我目前在手机上的实际程序。

Hope this helps

希望这可以帮助

#4


Once you know the revision number where the file was deleted (using the repository browser is probably the easiest way to find this). Do a check out to a new location before that revision.

一旦知道文件被删除的修订号(使用存储库浏览器可能是找到它的最简单方法)。在该修订之前检查一个新的位置。

#5


use revert option or open cmd window and type : (give the local path where you've checkout your code) svn -r (type revision no. before deleting that path)

使用revert选项或打开cmd窗口并键入:(给出检查代码的本地路径)svn -r(在删除该路径之前输入版本号)