News for hackers. Stuff that matters.
Re:Magit, the magical Git interface (2017) by leephillips on Friday October 22, 2021 @01:04PM (#28959733)
The default for `git reset`, which is `--mixed`, may do what you want. The difference between `--mixed` and `--soft` is that the former resets the index as well as moving the HEAD pointer; the latter only moves the HEAD, so if you’ve `git add`ed any changes, they will remain staged.
Re:Magit, the magical Git interface (2017) by rich_sasha on Friday October 22, 2021 @02:45PM (#28960962)
Wow this is a new level of Git hell I haven’t even heard about!
Re:Magit, the magical Git interface (2017) by leephillips on Friday October 22, 2021 @03:29PM (#28961559)
Yeah, keeping track of Git’s three areas (files, staged changes, repository) can get confusing. After some thought I think my advice to you to use `git reset --soft` would be better as just `git reset`, because that’s a neater “starting over”: it’s more of an “undo” of the last commit action, I guess. I often find myself reaching for `git reset --hard` after screwing up and not feeling like tracking down how I broke things.