lost library

i built up a nice size music library for my ipod. I accidentally erased it in itunes but it is still on my ipod itself. I can't seem to restore it in my library. How do I import from the ipod back to the library? Any help would be greatly appreciated. thanks