4 ms·
This should be a built-in git unshit Or git add --unshit -f ~HEAD^^ If you’re using git version <= 2.844.
by wruza 2y ago
This should be a built-in
git unshit
Or
git add --unshit -f ~HEAD^^
If you’re using git version <= 2.844.
- maleldil 2y agoJujutsu has `jj undo`, but which undoes whatever was your last jj command, regardless of what it was. It makes much more confident to do an operation I'm uncertain of. And if I regret something many actions down the line, you have `jj op log` (a better reflog).
- zahlman 2y agoIf you `jj undo` a second time, does it redo (undoing the undo), or does it back up another step?
- steveklabnik 2y agoIt redos, there's discussion about if and how this should change: https://github.com/jj-vcs/jj/issues/3700 https://github.com/jj-vcs/jj/issues/3700
- stouset 2y agoFor background, this is because the `undo` itself is an operation pushed onto the top of the stack. It is a little counterintuitive.
- blharr 2y agoSuch a simple operation, but it'd probably fix 95% of problems I've had with git. "Uh oh, I tried to checkout a branch from remote by doing `git checkout origin/some-branch` instead of `git checkout some-branch` and made a couple source changes. Now I'm in detached head state. What is detached head ? I have to stash my revisions? Can I make a new branch with the same name or do I need to delete the origin/some-branch that I'm on?" When you could be able to just revert the "operation" and check out the correct branch, that's amazing.