4 ms·
I've been using git for ~8 years and I've never heard of --soft
by brundolf 5y ago
I've been using git for ~8 years and I've never heard of --soft
- leephillips 5y agoThe 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.
- rich_sasha 5y agoWow this is a new level of Git hell I haven’t even heard about!
- leephillips 5y agoYeah, 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.