How do I get back the file my SVN client deleted?

I just updated SVN and one of my files is now gone ... of course it wasn't done because I knew I needed to update + merge first. I think maybe the guy renamed the file, which means my SVN client has deleted my file.

I am using VC ++ 2008 and Visual SVN.

Help ... and for reference, how should this sort of thing be avoided? Shouldn't you update before committing?

+1


source to share


4 answers


If you're looking for a file in VS, it is likely that the file still exists in your directory, but is no longer referenced in the project (since VS will only show your files in your project). If the file has been renamed, you probably won't be able to find it in Visual Studio anymore. I would check the actual directory where the file existed.

If not, you can check out the old file from the repository by clicking on the contained directory and reverting to the previous version containing the file (files deleted are operations in a directory).



The local copy of the file should not be deleted if there are changes. This type of thing is annoying, but hopefully doesn't happen as often (how often do you rename files?). Of course, this is exactly why you should update before committing. In this case, you need to manually merge the changes you made to the old file into a new file and make sure it still compiles.

+1


source


SVN should back up the file if you change it. Check if there is a file that starts with "." and has a version somewhere in the name in the directory where your modified file should be.



If not, check your settings in Visual SVN. Or maybe Visual SVN doesn't. Try TortoiseSVN instead.

0


source


This happened a few weeks ago. I got tired of "updating" instead of "committing". My work disappeared, I was able to restore some of them using the "Restore Tool" .

0


source


The answers show how to recover the file, but more important is your second part of your question: how to avoid such things?

To do this, you can lock files. This means that you want to work in this file unchanged. SVN will not allow another user to lock the file. This also includes deletion.

-3


source







All Articles