It seems files are still maintained in datastore after they are deleted. Are version indexes also maintained?

How are the files under /jackrabbit-webapp_default/server/default/jcr:root/jcr:system/jcr:versionStorage/… related to the document storage?

It is hard to get a clue from the coded file storage structure. How can administrator recover a deleted document?

Thanks in advance!