It is basic to maintain a backup. Have you failed to do so?
If for some reason you have failed to back up your music (terrible idea), then you can transfer itunes purchases from an ipod:
File>Transfer Purchases
From the terms of use of the itunes store:
" PRODUCTS CAN ONLY BE DOWNLOADED ONCE; AFTER BEING DOWNLOADED, THEY CANNOT BE REPLACED IF LOST FOR ANY REASON. YOU SHALL BE RESPONSIBLE FOR BACKING UP YOUR OWN SYSTEM,"
http://www.apple.com/legal/itunes/us/terms.html