views:

4952

answers:

7

Yes, I know it was stupid, don't rub it in, I'm freaking out here.

I didn't realize svn delete would delete my local copy, I just wanted it out of the repository. Now all my files are gone, and they aren't in the trash bin either. Is there any way I can recover them?


I should clarify, these files never made it into the repository. I was trying to get rid of some old junk in the repository so that I could check these in.

I'm running Ubuntu on an ext3 filesystem. It's okay though.... I managed to redo what I deleted in about 2 hours.

+3  A: 

Nope.

Not unless they're still in use by some other application, sorry.

Which brings into mind, does anyone else is on this project? They might have a copy.
Itay Moav
No, netbeans like to close files when they're deleted for some retarded reason... otherwise it would still been in memory.
Mark
Many IDE's tend to auto-reopen when they get foregrounded, this is mainly to help the development process along if a remote process modified part of a file so that you may continue working so that you don't get one version that is on disk and one version that is in memory.
X-Istence
@X: I understand that... if it was *modified* it might be a different story (with undo support), but to just close it without prompt? Not a clever design decision IMO.
Mark
+1  A: 

Can't you just check out whatever you were working again in a new directory? If you had any changes that were not versioned you are SOL, anything else you can just svn revert to the latest version in the repository.

X-Istence
Unfortunately not. I was trying to check them into the repository, but there were some conflicts with some older files sitting in the repository. I was trying to delete those so I could check in the new stuff... well this really blows.
Mark
this is exaclty the sort of thing that a DVCS helps with - you commit locally before you merge. guess you will have to put it down as experience
jk
+1  A: 

depends on your operating system, partition type, and how long you have used your computer since you deleted those files.

The longer you go, the more chance the system will overwrite the sectors your information was stored in.

I did this once "way back in the day", and I was able to recover about 90% of my work. So in all, I ended up only losing 3-4 hours of work. While it's been quite a few years, I used methods similar to whats on this link.

http://neverendinginternet.wordpress.com/2008/04/13/recovering-files-on-linux/

Again though, this was in linux, and this is what this site talks about. If you are in windows, you might try to google reagrding deleted file recovery. Sorry, no experience using windows for this problem.

I think files are easier to restore on windows actually... but I happen to be running ubuntu on ext3. I'll try this recovery utility, but the files are probably gone already. Thanks though
Mark
A: 

You have used 'svn delete' command and deleted local copy. It means original versions of files still exist in SVN history. 'svn delete' doesnot delete history of file from the repository. You can recover the last version in following way

  1. Check the SVN Log and find out the revision number of 'delete operation'.
  2. Use 'svn checkout' to check the revision just before the 'delete operation'. (e.g. if revision number of delete operation is 100, check out the revision number 99) svn checkout --revision
Nitin Bhide
Local changes he made are not in the revision repo and thus he can't recover those.
X-Istence
just saw the comment "I should clarify, these files were never made it into the repository." Somehow didnot realize it when I wrote the answer
Nitin Bhide
A: 

Depending on your SVN client you should be able to get these files from a previous revision using "Show Log" as its called in Tortoise...

Just open the log find a revision where that file was still there and "revert to this revision"

d1k_is
A: 

If you're under windows, you can check the (partially) free tool name zero assumption recovery. Really helps when you deleted files on windows!

Or else if you have it enabled and you're using vista you can check the "previous versions" of your folder in the properties of it.

hope it helps! good luck.

attwad
A: 

You run command svn log and get the revision number of the unhappy deletion. then run *svn merge -r2572:2571 svn://$PATH_WHERE_YOU_DELETED_NUMBER_WAS_ON_SVN_SERVER &LOCAL_PATH_WHERE_TO_SAVE_FILE*

where -r are the revision numbers

example merge -r2572:2571 svn://www.jane16.com/var/opt/svn/mypoject/Start.java C:/ecplipse/workspace/myporject/Start.java