Miromedia SEO Specialists company logo

Rollback a Subversion commit

January 20th, 2009 by Andrew Male

Using the subversion from the command line makes it much easier to accidentally commit changes across a whole project when you only really need to commit certain files that you were working on. If this were to happen you would assume there’d be an easy way to tell subversion “Sorry, I’ve commited that in error please rollback my changes” in a similar way to Microsoft SourceSafe. Unfortunately not.

So whilst looking for a way to do this I came across a solution, which involes a revision merge and commit; basically taking your changes back to a previous revision and then commiting that one.

svn merge -r 73:68 /location/of/your/files/my_file.php

svn commit /location/of/your/files/my_file.php -m "reverted to revision 68."

There was some minor housekeeping needed on the file after the initial merge to remove any conflicts but the process worked, if only this could be done with a single command.

Subscribe

News RSS Blog RSS

Follow us

Twitter LinkedIn
Click here for free website health check
Click here for free website health check