First read this: FAQ: Why iTunes Match Can Not Be Used as a Backup
So, before you sell your Mac make sure all your personal data is backed up to an external HDD then put that HDD in a safe place. When you return you will be able to use it to restore your data to the new Mac.
Before you sell your computer you must restore the original version OS X that was installed on it when you bought it. See this Apple KB article for how to prepare your Mac for sale: http://support.apple.com/kb/ht5189.