Re:Some bad Git situations and how I got myself out of them
by NickHolt on Friday September 09, 2016 @02:16AM
(#12459978)
The "committed to wrong branch" case is also a little overly complex. I'd just do:
[ Parent
| on HN ]
Re:Some bad Git situations and how I got myself out of them
by Dru89 on Friday September 09, 2016 @02:57AM
(#12460123)
This is less safe than the branching alternatives. Instead of "moving" the original commit, this copies the original commit to a new one and leaves the original one dangling and waiting to be garbage collected.
Also, if you have more than one commit before you noticed you were on the wrong branch, this only grabs the one commit.