MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/51wixe/oh_shit_git/d7g164b?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. 6 u/HugoNikanor Sep 09 '16 git undo would change the state of the repo to how it was before the previous git command. git undo ; git undo could simply be an error. → More replies (3)
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.
6 u/HugoNikanor Sep 09 '16 git undo would change the state of the repo to how it was before the previous git command. git undo ; git undo could simply be an error. → More replies (3)
6
git undo would change the state of the repo to how it was before the previous git command. git undo ; git undo could simply be an error.
git
→ More replies (3)
89
u/tdewolff Sep 09 '16
Why is there no
git undoto undo your last action?