1

What I am looking for here is how to manipulate Svn to effectively rollback my previous commit to the repository without affecting the changes I have made locally.

Let's say I do this:

$ svn ci abc.java -m "Updated abc"
Sending        abc.java
Transmitting file data .
Commited revision 123

And then realise that I don't want to make that update on the repository yet, but want to keep the changes I have made locally. I want my local files to stay the same, but the files on the repository to go back to revision 122.

I have only manged to find one way of doing this, is using a reverse merge:

$ svn merge -c -123 abc.java
--- Reverse-merging r123 into 'integer.c':
U    integer.c
$ svn commit -m "Undoing last change: rev 123."
Sending        abc.java
Transmitting file data .
Committed revision 124.

Unfortunately this means that I have to copy my local files elsewhere, before doing the reverse merge, and then copy my local file back after the commit.

I was wondering if there was a less circuitous way of doing this, where the operations only take place on the repository?

Thanks

1 Answer 1

2

1. Checkout new repo copy

2. Run:

svn merge -rHEAD:XXXX

(XXXX is the revision BEFORE the one you just committed)

3. Commit

4. Delete newly checked-out repo

1
  • Oooh nice one! Can't believe I didn't think of that one. Thank you!
    – bguiz
    Nov 22, 2009 at 1:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .