I haven't tested this, but it looks good. Must test soon. Preferably before I need to do it against someone's production setup :-)
Find and restore a single document from alfresco backup
Highlights:
Given the filename ${fname}
- load the database dump into a scratch db
- sql selects to identify which file on disk corresponds to the file you want (including which version)
- grab the file from the backup