Domanda

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?

È stato utile?

Soluzione

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.

Altri suggerimenti

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

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top