Restoring files or folders in SVN


To recover a folder or a file in svn, you can use the copy command to copy the folder from the revision of the repository before the file or folder was deleted (or modified). The syntax can be a bit confusing but here’s how it can be done. The first flag -r (i’m not sure if you need this the way this command is formatted) specified the revision you copy from. The next argument is the source and it needs to be the full path to the file or folder you’re recovering followed by @ and the revision number. then the location the to copy the data to (which can be just . for this folder).

Example:

svn cp -r 111 https://server/svn/path/to/folder@111 .
svn ci -m "restored file or folder"

, , ,

  1. No comments yet.
(will not be published)

Comments are closed.