You must have seen the below message several times during development. This message also shows current version and the previous version, which makes it clear that salesforce does maintain the version history of apex classes and VF pages.
Few questions: Is this version data accessible? If yes how do we access? Can we access the code component specific to a verison?