How do I return to an older version of our code in Subversion?

Basically you need to “merge backwards” – apply a diff between the current and previous version to the current version (so you end up with a working copy looking like the old version) and then commit again. So for example to go from revision 150 (current) back to revision 140:

svn update
svn merge -r 150:140 .
svn commit -m "Rolled back to r140"

The Subversion Red Book has a good section about this.

Leave a Comment