One good thing about subversion(svn) is that it does not only keep track of changes you make, it also offers the flexibility to roll back to previous versions. Restoring deleted files is one extreme case in this sense.
For example I want to recover the file
filen.txt at r25.
$ svn update -r 24 file.txt
Updated to revision 24.
This will pull
file.txt from the repository down to local working directory, but it will disappear after you do another update.
$ svn update
Updated to revision 25.
One way to avoid this is to use full path name in repository.
$ svn copy -r 56 svn://svn.imager.umro/masdar/trunk/mantis/mantis2_Gechuan/file.txt file.txt
$ svn st
A + file.txt
$ svn commit -m 'recover file.txt'
Committed revision 26.
Of course there are other more clumsy ways to do this. You can pull down the file from repo using relative path, change it, commit, then change it back, commit. This causes unnecessary log entries and can be confusing as time elapses.
The fourth column is
`+' when we do
svn st. This item is “scheduled with addition-of-history” according to the svn red book, which means it came with its own history that can be rolled back upon. c.f. here.
The fourth column will only show whitespace or a + which means that the file or directory is scheduled to be added or modified with additional attached history. This typically happens when you svn move or svn copy a file or directory. If you see A +, this means the item is scheduled for addition-with-history. It could be a file, or the root of a copied directory. + means the item is part of a subtree scheduled for addition-with-history, i.e. some parent got copied, and it’s just coming along for the ride. M + means the item is part of a subtree scheduled for addition-with-history, and it has local modifications. When you commit, first the parent will be added-with-history (copied), which means this file will automatically exist in the copy. Then the local modifications will be uploaded into the copy.
In case of wanting to recover a file a long time ago, use
svn log --verbose | grep -A5 -B5 file.txt
to show relevant log parts.