By far the easiest way to revert the changes from one or more revisions, is to use the revision log dialog.
选中想要恢复变更的文件或者文件夹。如果想要恢复所有的变更,需要选中最顶层的文件夹。
选择
→ ,显示出版本列表。有可能需要使用 或者 按钮,把想要恢复的版本显示出来。Select the revision you wish to revert. If you want to undo a range of revisions, select the first one and hold the Shift key while selecting the last one. If you want to pick out individual revisions and ranges, use the Ctrl key while selecting revisions. Right click on the selected revision(s), then select → .
如果想要把以前的某个版本变成最新版本,右键点击选中的版本,然后选择 → 。就能够撤销被选中版本后面所有的变更。
工作副本已经恢复到了变更以前的状态。检查恢复后的结果,然后提交变更。
If you want to enter revision numbers as a list, you can use the Merge dialog. The previous method uses merging behind the scenes; this method uses it explicitly.
在工作副本上选择
→ 。In the Merge Type dialog select Merge a range of revisions.
In the From: field enter the full repository URL of your working copy folder. This should come up as the default URL.
In the Revision range to merge field enter the list of revisions to roll back (or use the log dialog to select them as described above).
确保撤销合并选项框处于被选中的状态。
In the Merge options dialog accept the defaults.
点击
完成合并。You have reverted the changes within your working copy. Check that the results are as expected, then commit the changes.
因为TortoiseSVN绝不会丢弃数据,所以那些被回滚的版本仍然以中间版本的形式被保留在版本库里。只是最新版本已经回到了以前的状态。如果想让版本库里的某些版本彻底消失,擦去这些版本曾经存在过的所有痕迹,就必须采取更极端的手段。不推荐使用这种方法,除非有很好的理由。比如某人向一个公开的版本库里提交了一份机密文件。
The only way to remove data from the repository is to use the Subversion command line tool svnadmin
. You can find a description of how this works in the Repository Maintenance.