I recently started using Joplin and decided to trust it with some important notes. Then I accidentally deleted one. How can I recover it?
I have Note History enabled with history kept for 30 days (and I don't have syncing). The Note History page only says how to recover old versions of existing notes.
Is there a way to recover notes that were deleted?
If there's no easy way, I noticed the database has a deleted_items table, so could it could be done with a query?
Do you have a backup of your local files? Or of the files on the sync target? If so, you can recover from this. Otherwise the note might still be in the revision table but it's not currently possible to recover it from there.
If the note is particularly important, you should be able to restore it from the next version using the command palette. You'd type Ctrl+Shift+P, then "restoreNoteRevision NOTE_ID".
Thanks @laurent. I made a copy of ~/.config/joplin-desktop soon after deleting the note, just in case. I don't have a sync target since I've never used syncing.
I realized I was using an old version of Joplin that didn't have the command palette, so I upgraded to 1.8.5. In that version, Command+Shift+P works but "restoreNoteRevision" doesn't appear as one of the commands. I also don't know how to find the note ID, since the note is deleted.
You will need the next version 2.0.x, which is not released yet. For the note ID, there's no easy way to find it so you'll have to get it for example from the "item_id" field of the "revisions" table. You could look at the revisions and find which ones seem to be related to your note.