How to get my iphone music onto my new computer?

I recently got a new lap top and connected my iphone 4 to it but the music on my phone isn't on my computer I thought about synching it but it said something about deleting all music and apps and stuff from my phone so I didn't do it how can I do it without loosing any data?

Lug charger onto computer