How to undo a sync on itunes?

I accidentally synced my phone on itunes and now a bunch of songs are on my phone that were from the computer. How can I undo that sync so that I only have the songs I had on my iPhone before?

How many songs were transferred? You can erase unwanted songs by swiping your finger across the title to bring up the delete button.

You can also connect and instead of syncing choose manual management of music an video - much smarter than syncing. Just highlight the files in your iPod's music folder and hit delete.