Pristine file is an analog of Git blob. SHA-1 of contents of any pristine file corresponds to its name. da39a3ee5e6b4b0d3255bfef95601890afd80709 corresponds to empty contents.

.svn/wc.db is an SQLite database that contains all SVN-specific metadata (path, URLs, properties and so on). The most interesting table is NODES. It contains entries for every path in the working copy (1 entry if the path is not changed, more than 1 otherwise).

Here in the example one checksum is referenced twice. When the refcount in PRISTINE table becomes 0, corresponding pristine files are not deleted automatically, but only after "svn cleanup" command.

Every software contains a bug. Sometime refcount becomes wrong. If it is greater than actual value, it is not a problem. But if less, it can lead to a problem.

One won’t notice the problem immediately, but the working copy becomes a time bomb. refcount value may reach zero but some entries can still reference to a pristine file by SHA-1 checksum. If one runs "svn cleanup" and the pristine file is deleted, there’re problems: one can’t commit the file referencing to missing pristine, one can’t revert it, one can’t get working copy diff and so on.

Despite the fact that the problem is not so hard to resolve (and I hope SVN will be able to repair this some day), currently I know only one tool that allows to restore missing pristine files — SmartSVN. Unfortunately it is not free. Fortunately it has 30 days free period, that’s enough to repair the working copy.