Rolling back your Subversion repository to a previous, good revision
With other source control systems it’s possible to rollback your entire repository to a previous version. This is handy if you start heading down a path which you later decide wasn’t the right one and want to elimitate this from your source control’s memory. Think of it as CTRL-Z, or “undo” for your source control system.
Subversion doesn’t offer this capability directly, but you can achieve the same results using the merge command. So if you accidently check in some code that you want to then effectively remove from the tree, you can.
svn merge usage has three forms (run svn help merge for the full details) but the one I prefer looks like this:
svn merge -r<from>:<to> <repository> <working directory>
In the wild that translates to something like this (from within your checked-out trunk):
svn merge -r1455:1454 https://prime/svn/client/tfg/aurora2/trunk .
Follow this up with a check in:
svn ci -m "Rolled back to r1454"
Note that it doesn’t remove the broken revision (in the above case, r1455) from the repository. Instead you’ll get a new revision (r1456) which is identical to 1454. It’s still possible though for the broken version to be checked out if you specifies r1455.
This actually seems quite good as to do a full rollback and not keep track of the changes in that gap may loose more than what you were intending.
Well to my mind I like the SVN way because you want to be able to track everything. If people could choose to circumvent this then I think you lose the accountability and true source control aspect.
Yeah exactly. This gives you the roll back features without removing evidence that a roll back was necessary in the first place.