A colleague has been asking how to do this and I've found a great post written years ago. I've linked it here:
Versions
Metadata