Undo deletion of note

Use case or problem

As someone who likes to keep his notes database clean and organized, I often delete empty or no longer useful notes (Ctrl+Shift+Del). Often, when I do this too fast, I accidentally delete the wrong note, and immediately hit Ctrl+Z in attempt to recover the file from my Recycle Bin, to no avail.

Proposed solution

Since Ctrl+Z is used for Edit Mode undos, I suggest Ctrl+Shift+Z to undo all file movement / deletion related actions (similar to Mac/Windows file navigation behavior). For example, this feature would quickly remediate the following: dragging and dropping files into wrong folder, deleting the wrong note / folder, perhaps even creating a new note by accident?

Current workaround (optional)

I currently have to go to my recyble bin, look for and recover the said file.

Thanks!

4 Likes

You may want to look into using software revision control like “git”. I believe there is a plug-in called obsidian-git that helps automate this process.

1 Like

I have tried several community plugins (for other purposes) and from my experience those can sometimes be a little buggy.

Just curious if there is sufficient community support to warrant this feature as “default-behavior-worthy” to be included in future releases. Or at least added as a Core Plugin. Thanks for the response.

1 Like

Use case or problem

Set up: I have Obsidian’s “Deleted files” configured to “Move to system trash”, and env is Mac OSX Catalina with Obsidian 0.9.15.

Use-case: If 1) I accidentally delete a file from within Obsidian (either by right-clicking -> Delete or by keyboard shortcut, and then 2) I press cmd+z or select “Edit -> Undo”, nothing happens.

If I go to the system’s trash and I right click on the deleted note, the usual “Put back” menu option isn’t there and I can’t double-click to open the file and copy-paste the contents because you can’t open files while they’re in OSX’s system trash.

Proposed solution

  • Make Undo and cmd+z actually undo delete file operations if the file still exists.
  • Make files sent to the system’s trash have a “Put back” menu option so that it’s easier to recover them if for some reason you can’t recover them from within Obsidian.

Current workaround (optional)

I have to open the system’s trash and manually move the file to my vault.

7 Likes

@juan I’m glad we are on the same page on this. I now have the deleted files moved to Obsidian trash (.trash folder) option enabled in my settings, just as a safeguard in case I delete something valuable to my (frequently emptied) recycle bin.

Use case or problem
A new problem now arises, as for some reason, “.trash” folder does not show up in the file explorer panel on the left, nor does it show up in Ctrl+O searches.

Proposed solution
Display “.trash” folder in file navigation panel. And make Cmd+Z / Ctrl+Z undo file deletion, similar to my initial post.

1 Like

I may be a little obtuse (no comments necessary), but why is there an option for sending deleted files to a “.Trash” if there is no way to access the folder by the User? Or maybe the question should be…Why can I not Recover a deleted file when selecting the UI option “Move to Obsidian trash”?

3 Likes

I am with you on this as well. The UI is not great.

But the current stop-gap solution at least keeps my accidentally deleted notes “safe”, where I can retrieve it manually via file browser if I ever needed to.

I think all we need is a secondary option to have deleted files moved to a non-hidden folder- ‘Trash’, ‘Trash_Obsidian’, etc.

(or folder name customizable by user.)