I updated my iPhone 4 to the new iOS 4.2 release this afternoon–the inclusion of the free “Find My Phone” feature was the main reason–and my music disappeared. All 12GB, or 1627 songs.Fortunately the Apple Support Forums contain a string that explains how to fix it.
Plug your phone back into your computer. Within iTunes, play any song that’s on your iPhone. (In my case, my iTunes library is about 30GB, so I played one from the special iPhone playlist that I use to populate my phone.) Then resync.
It’ll still go through the five sync steps, including the backup step that can take forever if you’ve got tons of photos on your phone, but the actual music sync happens almost immediately–apparently the iPhone has just forgotten about your music, not deleted it.