If I delete a file in Subversion, how can I look at it’s history and contents? If I try to do svn cat or svn log on a nonexistent file, it complains that the file doesn’t exist.
Also, if I wanted to resurrect the file, should I just svn add it back?
(I asked specifically about Subversion, but I’d also like to hear about how Bazaar, Mercurial, and Git handle this case, too.)
To get the log of a deleted file, use
If you want to resurrect the file and keep its version history, use
If you just want the file content but unversioned (e.g., for a quick inspection), use
In any case, DO NOT use ‘svn up’ to get a deleted file back!