Actually you can redownload the music from iTunes on your computer.
If anyone still want to transfer music from iPhone to your computer, you can try out FonePaw iOS Transfer program, which can read all of them. Even support you to export selective items of medias to PC or Mac local.
Search it...