本文转载至:http://stackoverflow.com/questions/497670/whats-a-simple-way-to-undelete-a-file-in-subversion
If you just did
svn rm foo.txt
then you can undo that with simply
svn revert foo.txt
If you already checked in after doing the "svn rm
" then you can look at the log (svn log
), find the last revision where the file existed, and grab it from that version.
svn cp url/to/removed/foo.txt@4 foo.txt
How to remove a file from svn without removing the local copy:
svn rm foo.txt --keep-local
Or, of course, you could just copy to a temp file before svn rm'ing and then copy back:
cp foo.txt foo.txt-tmp
svn rm foo.txt
(svn ci -m "just removed foo.txt from the repository")
cp foo.txt-tmp foo.txt