I had to do this recently. Luckily I keep regular backups and was able to restore everything.
If you go to File > Library > Backup Library > Choose a safe place to save the backup.
It'll save all you playlists, histories, cue points, hot cues and other metadata for your tracks. Then it should just be a case of restoring the backup (File > Library > Restore Library) when you've reset the backup.
Steps I've given are for Mac, presume Windows are very similar (if not identical).