I accidentally deleted my Most Played playlist. How do I get that back?
Whether that’s one of iTunes’ default playlists or one configured yourself, you’re talking about a smart playlist, which is the easiest to re-create — all you have to remember are the parameters, and iTunes does the heavy lifting of finding the songs. Press Command-Option-N for a New Smart Playlist (also in the File menu), and whip up something like Kind Does Not Contain Video, however many tracks you like, selected by Most Often Played. If you want to exclude podcasts, music videos, and so on, add more conditions and use the dropdown menus to exclude by Media Kind.
Move this XML file to the Desktop, then reimport it back into iTunes to recover your old library, playlists and all.
But if you deleted a regular playlist (rather than a smart one), you can still get it back, provided you haven’t added any new content to your iTunes library in the meantime. Start by shutting down iTunes. Locate your iTunes folder — usually at /Users/your-username/Music. Inside, look for a file called iTunes Music Library.xml, and drag it out of the folder and onto your Desktop. Next, move the iTunes Library file to the Trash.
Now, open up iTunes, and select File > Library > Import Playlist. Use the file-selection window to navigate to the iTunes Music Library
.xml file currently marooned on your Desktop. Boom! iTunes will automatically re-create your lost playlist. As we warned earlier, make sure not to import any new content to your iTunes library until you’ve first imported the iTunes Music Library.xml file. Doing so will alter your iTunes music library, thus rendering the XML file useless.