News for hackers. Stuff that matters.
Re:How to undo almost anything with Git (2015) by jnurmine on Tuesday December 24, 2019 @04:41AM (#21870932)
There are other ways to do that, too. For example, Git stash is my blind spot and I don't really use it.

A conceptually simple way (for me) is to: checkout "good" branch, cherry-pick the "wrong" commit, then checkout the "bad" branch and remove the "wrong" commit ("git reset --hard HEAD^").

Mixing and matching simple commands mechanistically means everything can in fact be remembered.

YMMV.

Re:How to undo almost anything with Git (2015) by Doxin on Tuesday December 24, 2019 @05:12AM (#21871018)
You might want to try using rebase for this use case too, Saves a couple checkout steps. Just make sure to specify the right commit range ;)