views:

4222

answers:

3

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

+2  A: 

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.

EDIT: 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.

Noah Goodrich
Would this not tell you that your revision is out of date and require you to update before you commit? I think you need to merge the prior revision rather than just update to the old one.
Mnebuerquo
+29  A: 

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.

CMS
+6  A: 

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>

jcoby