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

Re: Lost my local file: please help

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-02-09 11:13:24 CET

On Feb 9, 2006, at 08:04, SJ wrote:

> I was trying to add a new set of files to svn for the first time.
>
> So i did:
>
> svn add blah.*
>
> It listed 3 files with "A".
>
> But I realized that I didnt need one of the files in svn. So i
> tried to undo this step so that I could retry by exactly specifying
> the two filenames.
>
> So i did
> svn cleanup
>
> But the 3 files still showed up as being "already added to svn"
> when I tried to commit. So I aborted the commit.

"svn cleanup" doesn't relate here; it's only useful if you've
forcefully interrupted a commit, say, and on your next attempt to
commit, Subversion prints a message saying you need to run cleanup.
If Subversion hasn't told you to run cleanup, running it won't help
anything.

The correct way to undo an inadvertent "svn add" before you've
committed them is to "svn revert" them. This reverts the add and
changes them back into unversioned files. So you could have used "svn
revert foo" where "foo" is the one file you didn't mean to add, or
you could "svn revert -R *" to recursively revert all changes in the
working copy, and then start over.

> Next I tried:
> svn rm blah.*
>
> This wiped out my local files and I had not committed these files
> so cannot recover them from svn.
>
> I have not committed the change yet. I am desperately trying to
> undo this svn rm step.
>
> Is there any way I can recover these files?

Based on my brief tests, it should not have been possible for you to
"svn rm" your not-yet-committed files. I tried making a new file
"bar" in a working copy and then using "svn rm"; it wouldn't let me:

$ echo foo > bar
$ svn rm bar
svn: Use --force to override this restriction
svn: 'bar' is not under version control

Then I added "bar," and, before committing, tried again to "svn rm"
it. No go:

$ svn add bar
A bar
$ svn rm bar
svn: Use --force to override this restriction
svn: 'bar' has local modifications

So either you're using an older version of Subversion and this
safeguard was added later (I'm running Subversion 1.3.0 on Mac OS X),
or you used the --force option to override the safeguard, or you did
in fact already commit the files to the repository before deleting
them, in which case they would still be there for you to recover them.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 9 11:26:10 2006

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