I had a developer 'revert' a file by deleting it from the repository and re-adding it. We now have a current file with no history. Is there a way to get back the deleted file. With it having the same name as existing file, how should I proceed? Yes, I have tried to read the docs but can't seem to get the right combination of actions to take.
Asked
Active
Viewed 2,142 times
2
-
It's so great when a "developer" older than you on company deletes file history on Subversion, or insists to not commit at all, and demands he's right and you're just trashing Subversion with "unecessary small commits" :/ – Hikari Feb 17 '13 at 01:39
3 Answers
5
- delete the file in your working copy
- in the repository browser, go to the revision where the original file still existed (i.e. before it was replaced)
- right-click on that file in that revision in the repository browser, execute "copy to working copy"
- specify the path in your working copy as the "copy to"-target
Now you have your file back including the history.

Stefan
- 43,293
- 10
- 75
- 117
-
1Ok. I have the file locally. I delete locally. I go to repository and go to the revision prior to the deletion of the file. I select 'copy to working copy' and get error:"Entry for 'C:\...\MyFile.ascx.cs' exists (though the working file is missing)" If I put the file back (locally) through "SVN Update" and try again, I get error "Path c:\...\MyFile.ascx.cs" already exists. If instead, I select "copy to..." and enter my local file location, I get error: "Source and dest appear not to be in the same repository(src:'svn://domain/.../MyFile.ascx.cs';dst:'file:///C:/.../MyFile.ascx.cs" – user638303 Mar 01 '11 at 18:47
-
1Got it. I had to TortoiseSVN Delete locally. I did 'copy to working copy' and then checked that file back in. As long as I deselect 'stop on copy/rename', I get full history. Thank you! – user638303 Mar 01 '11 at 22:53
1
see this thread here...
examining history of deleted file
to resurrect your file you can
svn copy url/of/file@lastrevisionthefileexisted -r lastrevisionthefileexisted path/to/workingcopy/file

Community
- 1
- 1

Brandon Frohbieter
- 17,563
- 3
- 40
- 62
0
On Linux, I solved the problem by following the steps on the command line:
svnadmin create TEST
svn co https://URL/svn/codes/JarLib/
Delete file or directory which is re-added
svn delete https://URL/svn/codes/JarLib/XXXX.jar -m "XXXX.jar history resurrect operation"
svn update
Use 'svn copy' command to get deleted file/directory with HISTORY. Revision number must be deleted file's/directory's last revision number!!!
svn copy https://URL/svn/codes/JarLib/XXXX.jar@22467 -r 22467 XXX.jar
Operation below will add XXXX.jar to your Working Copy then commit the changes.
svn commit -m "deleted file/directory is resurrected"
To control: Go to SVN Server and use svnlook command like:
svnlook history /svn/repos/codes /JarLib/XXXX.jar --show-ids