4 ms·
Just a tiny correction: git reset <ref> defaults to --mixed, not --soft. The only difference is whether or not files are staged. Since the OP used --soft, I bel
by evanelias 10y ago
Just a tiny correction: git reset <ref> defaults to --mixed, not --soft. The only difference is whether or not files are staged. Since the OP used --soft, I believe the subsequent `git add .` is unnecessary since the files should already be staged when --soft is used.
Regarding the case of an erroneous force push removing code, usually things can be recovered by looking through the reflog and doing some surgery via the lower-level plumbing commands... it's not exactly a fun process though :)