Thursday, July 21, 2011

Restoring Deleted Files/ Folders - with history

Most often people find it a drawback that SVN offers delete rights to all users. And the common concern being that anybody might accidentally delete some data and then the history might be lost.
But this is just a misconception and the data can be retrieved with history. Just follow these steps using TortoiseSVN:

1. Right click the parent folder that contains the deleted files/folder
2. Select "Show Log"
3. Select and right click on the version before which the file was deleted
4. Select the "Browse Repository"
5. Select the file/folder which needs to be restored and right click
6. Select "copy to" which will copy the files/folders to the head revision

Same results can also be achieved by using the svn copy command.