I hope you saved the music files on your SD card and you use Google Play Music to play the music files like any other music players available in the play store.
In this case, by formatting the SD card, you happen to erase music files from your SD card. But, in reality only the link to the music files gets deleted, by using recovery software’s you will be able to restore the deleted music files quickly.
Note: Don’t try to fill the SD card space with new music items unless the deleted music has been recovered. This may result in corruption while recovering.
Hope you have good time recovering back music files.