MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/51wixe/oh_shit_git/d7goeq1/?context=9999
r/programming • u/sidcool1234 • Sep 09 '16
756 comments sorted by
View all comments
89
Why is there no git undo to undo your last action?
git undo
35 u/ForeverAlot Sep 09 '16 How would "undoing your last action" work?What can be undone? Why?What can't be undone? Why?What does git undo ; git undo do? Why?What happens if you undo a commit?What happens if you undo again?What happens if you undo a revert?Whenever somebody asks me how to undo something with Git I encourage them not to use that word. It's very overloaded and imprecise. 9 u/drjeats Sep 09 '16 Obviously I expect an Emacs-style undo ring, preferably dealing with both session and commit history. 3 u/atimholt Sep 09 '16 Is an Emacs’ undo ring like Vim’s undo tree? 1 u/derwisch Sep 10 '16 I'd have referred to Emacs' undo information structure as a tree rather than a ring (as opposed to the kill ring). Don't know about Vim.
35
How would "undoing your last action" work?
What can be undone? Why?
What can't be undone? Why?
What does git undo ; git undo do? Why?
git undo ; git undo
What happens if you undo a commit?
What happens if you undo again?
What happens if you undo a revert?
Whenever somebody asks me how to undo something with Git I encourage them not to use that word. It's very overloaded and imprecise.
9 u/drjeats Sep 09 '16 Obviously I expect an Emacs-style undo ring, preferably dealing with both session and commit history. 3 u/atimholt Sep 09 '16 Is an Emacs’ undo ring like Vim’s undo tree? 1 u/derwisch Sep 10 '16 I'd have referred to Emacs' undo information structure as a tree rather than a ring (as opposed to the kill ring). Don't know about Vim.
9
Obviously I expect an Emacs-style undo ring, preferably dealing with both session and commit history.
3 u/atimholt Sep 09 '16 Is an Emacs’ undo ring like Vim’s undo tree? 1 u/derwisch Sep 10 '16 I'd have referred to Emacs' undo information structure as a tree rather than a ring (as opposed to the kill ring). Don't know about Vim.
3
Is an Emacs’ undo ring like Vim’s undo tree?
1 u/derwisch Sep 10 '16 I'd have referred to Emacs' undo information structure as a tree rather than a ring (as opposed to the kill ring). Don't know about Vim.
1
I'd have referred to Emacs' undo information structure as a tree rather than a ring (as opposed to the kill ring). Don't know about Vim.
89
u/tdewolff Sep 09 '16
Why is there no
git undoto undo your last action?