4 ms·
What git needs is a simple undo command, as in git undo and it just undoes whatever you just did. There seems to be a way to undo pretty much anything, bu
by iconjack 11y ago
What git needs is a simple undo command, as in
git undo
and it just undoes whatever you just did. There seems to be a way to undo pretty much anything, but I usually end up googling and deciphering the likes of
git reset HEAD hard -f --now origin/master --no-rebase %${%&`+'${`%&NO CARRIER")
Then when that goes wrong, you're in real trouble and left scratching your head at git's error message.
- kelnos 11y agoHmm, the reflog usually (always?) provides all the info you need to undo the last action. I wouldn't be surprised if it were possible to build a "git undo" command on top of that. The fact that no one has yet done so is a great illustration of your point, though.
- kragen 11y agoThe reflog just lets you undo commits (whether created by `git commit` or rebase or merge or whatever), while actions like `git reset`, `git checkout`, `git add`, `git gc`, and `git rm` cannot be undone with the reflog.