Git Undo
megakemp.com
Git Undo
1–10 of 175 posts
Re: Git Undo
#2Ideally, with all of the -p commands, git wouldn't actually apply any of the changes I specified until it was about to quit (i.e. either when I advance past the end of the set of potentially-affected hunks, or I manually type 'q'), and then would prompt me for whether {set of operations I specified} is what I wanted to do. This would leave the -p operations the the flexibility to expose an 'u'ndo.
Re: Git Undo
#3The only non intuitive thing might be, that calling e.g. 'git undo' twice doesn't undo the last two changes, but the first undos the last change and the second one undos the undo.
Re: Git Undo
#4Re: Git Undo
#5Re: Git Undo
#6Re: Git Undo
#7Re: Git Undo
#8Re: Git Undo
#9If you want to know how many steps back you need to undo, you still need to check reflog. This means you're better of just resetting manually to the change you want.
Re: Git Undo
#10Most git command-lines are lengthy enough to give me time to consider them, so I don't often feel the need to "take back" a git invocation. What I do often screw up, though, is the (almost hypnotic) tapping of y/n when doing a `git {add, reset, checkout} -p` to prepare and clean up a commit. Ideally, with all of the -p commands, git wouldn't actually apply any of the changes I specified until it was about to quit (i.…