Monday, April 28, 2008

SVN recover deleted files

Two steps

1) svn log --verbose
2) svn up -r 123457 file.txt

where 123457 is any revision that you want to get the file from.

References:

http://seamlesstrust.org/trustwiki/index.php/SVN_Recover_Deleted_Files

3 comments:

Unknown said...

Hi Anil,

It won't work this way. The second command would fail as the working copy will (ideally) not have the delted file.

It should be

svn cp -r 123457 REPO_PATH/file.txt ./file.txt

Where REPO_PATH is the remote repository path. (Not the working copy.)


Cheers
Sukesh Nambiar

ml said...

> svn cp -r 123457 REPO_PATH/file.txt ./file.txt
Above line did not work for me. I had to:
svn cp REPO_PATH/file.txt@123457 file.txt

ml said...

> svn cp -r 123457 REPO_PATH/file.txt ./file.txt
Above line did not work for me. I had to:
svn cp REPO_PATH/file.txt@123457 file.txt