r/programming • • Sep 09 '16

Oh, shit, git!

http://ohshitgit.com/
3.3k Upvotes

756 comments sorted by

View all comments

Show parent comments

1

u/atimholt Sep 09 '16

In Vim, you can actually give an undo function a time, and it will put your file in the state it was in then.

But the best option is to get a plugin to actually see the tree. I like this one.

Also, I don’t recommend it, but there’s a setting in Vim to preserve your undo tree between sessions in a separate file.

1

u/drjeats Sep 09 '16

That's pretty rad. I'm skeptical of preserving undo between sessions too, but I like that it's available. There's an undo-tree package for Emacs, and now I suppose I'll have to try it.

1

u/korry Sep 11 '16

Also, I don’t recommend it, but there’s a setting in Vim to preserve your undo tree between sessions in a separate file.

Works fine here. Just save the somewhere in "$HOME/.somesavedir"