We can't officially recommend software here that can be used for piracy.
I know this is a common problem, you forgot to make a backup of your music on your Mac and your iPod has the only copy.
Presently iTunes will only copy back from a iPod music that was purchased from iTunes Music Store.
For rips, MP3's everything (including iTMS), etc you have to turn to other third party software, which we are not allowed to mention here.
You can find your answer on more liberal forums like MacRumors.
Next time make plenty of backups, then this problem will not occur again. 🙂
Most commonly used backup methods