0

I'm using ProjectLocker with TortoiseSVN and VisualSVN.

Last night while trying to figure out a wierd issue, I reverted a couple files back to the last date that was in production. That happened to be about 3-4 revisions back.

When the older files didn't help the problem, I tried to do an update to get back to the most recent revision for the two files in question.

I see now (thanks to "Similar Questions") that I should have used Update to Revision instead of Revert.

The question is, can I get those revisions back somehow?

bahrep
  • 29,961
  • 12
  • 103
  • 150
CodeRedick
  • 7,346
  • 7
  • 46
  • 72

3 Answers3

1

Revert your revert, and the files will be like 2 revisions ago.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
1

You should be able to revert to the revision before you reverted.

SVN doesn't directly support Rollback ("Revert" as tortoise calls it). Instead it takes a copy from the old revision and copies it over the new one.

But that still leaves the revision you were reverting away from in place. When you revert this time you may need to use a peg revision (eg for revision 123 you're reverting to http://mysvndomain.com/repos/foo/bar@123.

Philip Couling
  • 13,581
  • 5
  • 53
  • 85
  • 2
    In Subversion, "revert" *does* have meaning - but not the meaning that's being used here. A Subversion "revert" is undoing uncommitted changes in a working copy. What's described here is better described as "undoing or rolling back a set of revisions." – alroc Jul 26 '13 at 15:15
  • 1
    TortoiseSVN abuses the word "revert". Its log dialog also has options to "revert to this revision" and to "revert changes made by this revision". The first one actually means "put your working copy as it was after this commit". The second one actually means "undo the changes done by this commit in the working copy". – JB Nizet Jul 26 '13 at 15:40
  • @JBNizet It's not abused, it's *overloaded* :) – alroc Jul 27 '13 at 17:46
1

The word "revert" has special meaning in Subversion, and it's not what you're using it for here. A Subversion revert means to undo any uncommitted changes in your working copy - repository state is not touched in this case.

Update to Revision is also not applicable here, as you cannot commit from that state.

What you should have done initially is what's known as a reverse merge. You apply a merge of one or more changes to roll the repository state back to what it was in a previous revision (your last production revision), instead of just copying the files and then committing them as a new revision. You can still do this in your current situation - reverse merge the change you just committed, and commit that. That will put you back at the "most recent". Your revision history will look a little weird, but not completely broken.

alroc
  • 27,574
  • 6
  • 51
  • 97