The first obstacle to using this method for recovery is finding Notes' storage location. It's not at all obvious. You'll find it in your home Library at ~/Library/Containers/com.apple.Notes/Data/Library/Notes/. To go there, enter the path string in the Finder's Go to Folder window; this works whether or not the Library folder is invisible on your Mac.
Once inside this folder, you should see a small assortment of similarly named files, with names such as NotesV2.storedata. The text of all your notes, typically including recently deleted notes, is stored within one or more of these files. Unfortunately, the format of these files does not make it easy to view the content of each note. To recover an individual note, you have a bit more work to do.
1. The two files that offer the best bet for data recovery are the .storedata and (especially!) the .storedata-wal files. Make a copy of these files and move them to a separate location, such as the desktop.
Making copies is a common safeguard. You'll work with these copied files. In case anything goes wrong, the original files remain untouched and in place.
2. Add an .html extension to the name of the copied files, confirming that you want to make this change when the question dialog box pops up.
As it turns out, these files employ HMTL tags. Adding the extension allows the critical text to appear in a more easily readable format.
3. Open one of the files in a text processing app (such as TextEdit) or in a web browser. Interspersed among all the cryptic text should be readable versions of both your current and recently deleted notes. Because there can be a lot of data here, I suggest using the app's search feature to locate the text you want to recover. Once you have, copy and save it to a separate location. If the first of the two files does not bear fruit, try the other.
Retrieve from backup
If you are unable to recover the deleted data via either of the two previous methods, you have one final option — assuming you've been backing up your data with Time Machine (or similar software). To do so, enter Time Machine and locate a version of the Notes storage folder that just precedes your deletion. Replace the current folder in your Library with the backup version (first making a copy of the current folder). When you next launch the Notes app, your missing file should reappear. If so, you can now transfer the recovered data to another location. When done, return the current Notes folder to the active location, deleting the backup version, and you are back in business. Although I haven't tried this method myself, articles I've read online confirm that it works.
Sign up for Computerworld eNewsletters.