On 2011-02-06, at 04:10, Aristotle Pagaltzis wrote:
You probably want this instead:
git stash
git reset --hard HEAD^
git stash pop
It will move your HEAD ref back one commit and throw away the
changes from that commit, but will preserve any delta between it
and your working copy. If too much has changed you’ll get a merge
conflict, but the stash will be kept. So you can reset the reset
and re-apply the stash on the commit it came from – which gives
you the exact same state that you started with. (And in any case,
stashing makes a record of the state of your working copy in git,
which makes it hard to lose that data entirely.)
THIS is a git undo button.
Thank you! Thank you thank you thank you! I KISS YOU!