3

A branch got removed from our repository, and now we think it has code we want to keep after all...

command line, Tortoise, SmartSVN, all good...

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Number8
  • 12,322
  • 10
  • 44
  • 69
  • Possible duplicate of [Need to restore a deleted branch in Subversion](https://stackoverflow.com/questions/1568484/need-to-restore-a-deleted-branch-in-subversion) – BatteryBackupUnit Oct 04 '17 at 12:32

4 Answers4

10

Copy the revision before it was removed, this will restore the branch as it existed in [REVISION] to the HEAD revision.:

svn copy -r [REVISION] http://svn/path/to/branch http://svn/path/to/branch

Edit: Clarification added thanks to Michael Hackner.

Community
  • 1
  • 1
MarkPowell
  • 16,482
  • 7
  • 61
  • 77
  • To clarify: this will restore the branch as it existed in [REVISION] to the HEAD revision. – Michael Hackner Oct 30 '09 at 20:47
  • 1
    Thanks for the reply. I did this with checkout, instead, to get a local copy. – Number8 Oct 30 '09 at 22:43
  • Which requierement it has ? `svn: E160013: File not found: revision XXXXX, path '/yyyyyy/branches/Branch_v1_0_0'` I think the origin must not be a `svn://` link but a local path... – Sandburg Oct 19 '18 at 15:01
6

This is the same thing as MarkPowell's answer, but specific to TortoiseSVN.

View the log for the branch's parent folder, find the revision you want, right click and choose "Create branch/tag from revision", right at the bottom of this screenshot:

alt text

Community
  • 1
  • 1
Yoopergeek
  • 5,592
  • 3
  • 24
  • 29
0

Can't you use repo browser and go back a couple revisions?

Am I missing something?

Chuck Conway
  • 16,287
  • 11
  • 58
  • 101
  • Not a regular Tortoise user; so far, that has the easiest to use interface for browsing previous versions. Thanks. – Number8 Oct 30 '09 at 22:42
-4

Is the server a Unix box? If so, you can try plugging it into another machine and then without mounting it, dd the contents of the device to a file... You could then use a combination of strings and grep to locate the bits of value... Though this is tedious and not much fun...

dicroce
  • 45,396
  • 28
  • 101
  • 140
  • 3
    This isn't necessary with Subversion. Subversion keeps stuff, unless you dump the contents of the repository to another file, remove stuff from that, and dump it back in. (Yes, that does sometimes constitute a problem.) The data's there somewhere, the only problem is getting Subversion to use it. – David Thornley Oct 30 '09 at 20:05
  • Since the OP specifically mentioned TortoiseSVN, and that's a shell extension for Windows Explorer, chances are VERY good it's not a Unix box. Also, as David mentioned, none of the other stuff in your answer applies either. – Ken White Oct 30 '09 at 20:08
  • diroce asked if the server was Unix. TortoiseSVN is a client. The fact that a client runs on Windows tells us nothing about the server's OS. – cdmckay Oct 30 '09 at 20:14