Sascha Möllering
Sascha Möllering

Reputation: 381

Accidently deleted SVN tag

I accidentally deleted a SVN tag. Is it possible to recreate this tag easily ?

Upvotes: 6

Views: 1006

Answers (3)

John Haager
John Haager

Reputation: 2115

If you are using the command line, the typical method is to do a "reverse merge". For example, if version 125 was the checkin that deleted the tag directory, then you would execute a command like this: svn merge -r 125:124. Subversion will pull the previous version with the tag out of the history into your working copy. Once there, you can do a commit to commit the change back in.

Upvotes: 1

Andrea Colleoni
Andrea Colleoni

Reputation: 6021

You can't undo. You can re-create the same tag copying the same revision from the trunk and giving it the same name.

Upvotes: 0

Taryn East
Taryn East

Reputation: 27747

A tag is just a copy of the SVN tree at a certain point. You should be able to recreate it in the same way that you created it. eg svn cp trunk tags/my_tag If you need it to be a tag of a particular revision, then you pass in the revision number with -r

Alternatively, you can probably restore the original tag by doing a "reverse merge" on the checkin where you deleted the tag - but that's more complicated. Google for that if you'd like to try it instead.

Upvotes: 6

Related Questions