Undoing a commit in TortoiseSVN

SvnTortoisesvnUndo

Svn Problem Overview


I committed a bunch of files (dozens of files in different folders) by accident. What is the easiest, cleanest (and safest!) way to 'undo' that commit without having to delete the files from my working directory?

Svn Solutions


Solution 1 - Svn

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.

Solution 2 - Svn

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>

Solution 3 - Svn

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionManuView Question on Stackoverflow
Solution 1 - SvnChristian C. SalvadóView Answer on Stackoverflow
Solution 2 - SvnjcobyView Answer on Stackoverflow
Solution 3 - SvnNoah GoodrichView Answer on Stackoverflow