tags:

views:

322

answers:

2

I have a revision that has been committed to SVN trunk which I would like to roll back. However, I would like to retain the changes in some fashion such as a branch or even a patch file. Any suggestions?

+8  A: 

Reverse-merge (I think that was the term), commit and that's all.

For the "reverse-merge" part - TSVN has this cool feature called "Revert to this revision" (and "Revert changes from this revision"), accessible through the Log dialogue.

The main purpose of a VCS is to keep history of your changes. You could always go back to this particular revision by using "Update to revision..." or by using the aforementioned "shortcuts".

Milen A. Radev
And would I reinstate the changes at a later date?
Oleg Barshay
You can restore the changes by reverting the previous revert.
Greg Hewgill
Makes sense, thank you.
Oleg Barshay
This just saved my life :-)
cagcowboy
Odd - I don't see the "Revert to this revision" option. Is there a security setting that could hide this option from me?
Mike C.
@myself, I was going in through the Repo Browser, which is why the option was not available.
Mike C.
+1  A: 

You can specify a particular revision when you do a copy (ie. branch).

Something like:

svn copy -rsome_revision trunk branches/interesting_branch

So roll back your changes in your trunk and then do your branch, specifying the revision before you commited your rollback (merge).

You can also capture the differences as a patch file, if that's what you really want to do, by redirecting the output of an svn diff to a text file. But that's usually not necessary, as the subversion merge commands give you this flexibility already.

Andrew Edgecombe