0

Suppose I have trunk with revisions from 1 to 20. I remove code from revisions 15 to 20 from trunk using reversed merge. Now, in trunk, I have code until revision 14.

If I need to bring back revision 18 to trunk, how do I do that?

Peter
  • 111
  • 1
  • 1
  • 8
  • possible duplicate of [svn: How to revert somebody else's commit?](http://stackoverflow.com/questions/28266893/svn-how-to-revert-somebody-elses-commit) – alroc May 13 '15 at 15:50
  • I'm pretty sure it's the same way - a reverse merge. – alroc May 13 '15 at 15:51
  • I tried it using both by checking and unchecking the 'reversed merge' checkbox. I got the message 'Merge: No changes found.' – Peter May 13 '15 at 16:08
  • What did you try? I would expect a forward merge of version 18 would do it. But if that doesn't work you can manually export a patch and apply it. – Ben May 13 '15 at 16:31
  • @Ben, I couldn't find a 'forward merge'. Manually exporting patch worked. Thanks! Btw, is there a 'forward merge'? – Peter May 13 '15 at 17:38
  • I just mean a normal merge, as opposed to a "reverse merge". I'll add the patch method as an answer I guess. – Ben May 13 '15 at 17:40

1 Answers1

3

While you may be able to get a merge working in some way or another, the sure-fire way is to create a patch from the revision you want to restore, and apply that patch to the HEAD of your repository.

  1. In the "Show Log" dialog, right-click the revision you want to restore.
  2. Choose "Show changes as unified diff" from the menu.
  3. Save the resulting diff to a patch file at your working copy root.
  4. Right-click on the patch file and choose TortoiseSVN→"Apply patch..."
  5. Patch and save all files
  6. Commit the changes
Ben
  • 8,725
  • 1
  • 30
  • 48
  • 2
    A patch will definitely work. The only caveat is that you lost the history in the repository that says "this version is the result of changes in version 18 being redone/backed out". If that's not critical (and that is probably the case for a large number of users), then the merge isn't necessary. – alroc May 13 '15 at 20:41