mpen
mpen

Reputation: 283043

Undo SVN delete ./* --force

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.

Upvotes: 8

Views: 14805

Answers (7)

karim
karim

Reputation: 15589

Going to the file directory,

svn revert "filename"

will restore any file locally deleted, yet not committed, but already under version controlled.

Upvotes: 1

user260937
user260937

Reputation: 1

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

Upvotes: 0

Nitin Bhide
Nitin Bhide

Reputation: 1695

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

Upvotes: 0

attwad
attwad

Reputation: 945

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.

Upvotes: 0

dkarzon
dkarzon

Reputation: 8038

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"

Upvotes: 0

X-Istence
X-Istence

Reputation: 16667

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.

Upvotes: 1

user90052
user90052

Reputation: 2706

Nope.

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

Upvotes: 3

Related Questions