[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Reverting a delete

From: Blair Zajac <blair_at_orcaware.com>
Date: Wed, 06 Feb 2008 22:18:52 -0800

Giulio Troccoli wrote:
> One developer deleted a file (with svn delete) and committed. Now we
> want that file back. I can think of two ways to do that:
>
> 1. update to the revision before the deletion, make a copy of the file,
> update to HEAD, move back the file, svn add and svn commit
> 2. update to HEAD, reverse merge the revison that deleted the file (svn
> merge -c-<rev>), svn commit
>
> The end result is obviously the same: I will have my file back. However:
> - the first method does not preserve the history of the file
> - none of the methods is a cheap copy

That's not true. The second method is still a cheap copy. You'll see that the
file is a copy of an existing file. Doing the status should show

A + filename

svn info will show the file as a copy:

$ svn info filename

Copied From URL: file:///tmp/repos/filename
Copied From Rev: 1

So doing the reverse merge is the easiest way.

Regards,
Blair

-- 
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<blair_at_orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-07 07:19:22 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.