Syncing my iPhone with iTunes restores music I previously deleted from the device One of the new features in iOS 5 is the ability to delete music in the Music app directly on the device, by swiping to delete like you do in Mail. This is great for me because my iPhone is generally pretty full, so as I add new music/apps/podcasts, I can go back through and delete stuff I no longer listen to in order to free up space.

However - when I sync my iPhone with iTunes, it copies everything I deleted right back! It must see that I have music on the computer that I've told it to sync, recognizes that those files aren't on the device, and copies them back over.

Is it me, or is this a bug? What would be the purpose of being able to delete files directly from the device if they get copied back over every time you sync?
You will need to use the manually manage music and videos option - otherwise, as you've already experienced, a sync will restore the deleted music to your device.

Steps for doing this are available at this Apple Support KB:


  
  Connect the device to your computer.
  Open iTunes.
  Select iPhone, iPad, or iPod in the Devices list.
  Click the Summary tab and select "Manually manage music and videos".
  Click Apply.
  Even when you have enabled manual management, you can still sync some content automatically. Select any content tab, such as Video, to enable automatic syncing for that type of content.
  


Another KB shows how to use this option to sync music for an iDevice with multiple computers. It also shows a picture of the screen that you'd see: