recover deleted node

54 views
Skip to first unread message

andyjim

unread,
Mar 7, 2020, 10:21:53 AM3/7/20
to leo-editor
I deleted a node I didn't mean to delete.

I assume revert/refresh is the way to recover that, but what is the difference between "Refresh from disk" and "Revert to saved"?

Or is there a direct way to recover it? (can't undo)

Edward K. Ream

unread,
Mar 7, 2020, 10:25:25 AM3/7/20
to leo-editor
Deleting a node is undoable. If you then close Leo, the only way to undo your change is git checkout.

Edward

andyjim

unread,
Mar 7, 2020, 11:25:58 AM3/7/20
to leo-e...@googlegroups.com
On Saturday, March 7, 2020 at 10:25:25 AM UTC-5, Edward K. Ream wrote:

Deleting a node is undoable. If you then close Leo, the only way to undo your change is git checkout.

Edward

I have not closed Leo since deleting, and I have not saved the file since deleting. So is that node still in the file on disk?
And if so, can I use "refresh from disk" or "revert to saved"? Which if either? Or close without saving, perhaps?

I am not familiar with git checkout. (not familiar with git, though I sorta know what it is)

Edward K. Ream

unread,
Mar 7, 2020, 1:49:26 PM3/7/20
to leo-editor
On Sat, Mar 7, 2020 at 10:26 AM andyjim <andy...@gmail.com> wrote:

I have not closed Leo since deleting, and I have not saved the file since deleting. So is that node still in the file on disk?

Leo never actually deletes any node data until you close Leo. This is because Leo supports unlimited undo.

delete-node is undoable, so undo should recover the node.

Edward

jkn

unread,
Mar 7, 2020, 3:23:23 PM3/7/20
to leo-editor
FWIW I used to create a 'delete-with-confirm' command, and use the keybinding for that instead of just
'delete-node'. It always seemed just a bit too easy to delete node(s) otherwise...

I don't seem to do this anymore - I can't remember quite why; I suspect I have just got a bit
more confident about Leo's undo facility. You could setup something similar in the future if it helps, though.

    J^n


andyjim

unread,
Mar 7, 2020, 3:25:13 PM3/7/20
to leo-editor
On Saturday, March 7, 2020 at 1:49:26 PM UTC-5, Edward K. Ream wrote:

delete-node is undoable, so undo should recover the node.

Edward

It says "Can't undo".  No help from "Refresh from disk" or "Revert to saved"?

Thomas Passin

unread,
Mar 7, 2020, 3:28:09 PM3/7/20
to leo-editor
Edward wrote about "Undo".  The usual way to do this is with "CTRL-Z", once for every action (i.e., keystroke").  So if you typed 20 characters after the delete, you might have to hit CTRL-Z 20 times (sometimes several keystrokes may be undone at once, so it may not be exactly 20).  It works - I've done the same thing.

The suggestion of getting it back from GitHub probably doesn't apply to you. If you had earlier versions of your work under version control on Github, then you could get back an earlier version.  But you probably haven't been using that.

Thomas Passin

unread,
Mar 7, 2020, 3:30:32 PM3/7/20
to leo-editor

On Saturday, March 7, 2020 at 3:25:13 PM UTC-5, andyjim wrote:

It says "Can't undo".  No help from "Refresh from disk" or "Revert to saved"?

Probably not.  If you hadn't saved the outline after the delete, then you could have closed it without saving and then reloaded it again.  You would have lost your work since the last save, but the node would have been there.

andyjim

unread,
Mar 7, 2020, 7:07:50 PM3/7/20
to leo-editor
On Saturday, March 7, 2020 at 3:30:32 PM UTC-5, Thomas Passin wrote:

Probably not.  If you hadn't saved the outline after the delete, then you could have closed it without saving and then reloaded it again.  You would have lost your work since the last save, but the node would have been there.

No I did NOT save after the delete. Undo does not work from the menu, but Cmd-Z worked. I guess on Mac, Command is Control.

So I've got the lost node back.  Thanks all for the help.

Thomas Passin

unread,
Mar 7, 2020, 8:10:43 PM3/7/20
to leo-editor


On Saturday, March 7, 2020 at 7:07:50 PM UTC-5, andyjim wrote:
 Undo does not work from the menu, but Cmd-Z worked. I guess on Mac, Command is Control.

So I've got the lost node back.  Thanks all for the help.

Whew! Hurray!  And yes, as best as I know, CTRL (Windows) <==> CMD (Mac).  I'm sorry I forgot that when I wrote earlier.

Edward K. Ream

unread,
Mar 8, 2020, 5:54:51 AM3/8/20
to leo-editor
On Sat, Mar 7, 2020 at 6:07 PM andyjim <andy...@gmail.com> wrote:

No I did NOT save after the delete. Undo does not work from the menu, but Cmd-Z worked. I guess on Mac, Command is Control.

For the record, on Windows the Delete key deletes the node and puts a functional Undo Delete Node entry in the Edit menu.

Edward
Reply all
Reply to author
Forward
0 new messages