在 TortoiseSVN 中撤消提交

我不小心提交了一堆文件(不同文件夹中的几十个文件)。什么是最简单,最干净(和最安全!)不用从我的工作目录中删除文件就可以“撤销”提交的方法?

56816 次浏览

You can revert your working copy to the revision prior to the commit. Once you have reverted your working copy, then simply commit the changes and you will effectively rolled back the accidental commit.

In a case like yours specifically, I would probably check out the revision that I wanted to roll back into a new working copy and then commit the working copy to the head revision.

Go to Show Log Screen, select the revision that you want to undo, right click it and select Revert changes from this revision, this will do a reverse-merge.

You may need to use the command line, but you can use the SVN merge command and specify the revisions in reverse to effectively revert a commit. Assuming your bad commit was r1123, you would do:

svn merge -r1123:1122 <url of your working copy>