by mjsir911 · 4y ago · 0 comments
Harder with an amend due to having to get the difference of commits within the reflog, sure.
git reset --soft HEAD~n
where n is the number of commits I want to undo.Known issue: can't undo all the commits.
Git switch is also something I learned recently so sometimes I type checkout because of force of habit but I am trying to do better (even though I'm not sure what switch dies that checkout can't but don't want to get into arguments, just want to do things the prescribed way).
Or if the commit should for some strange reasons really never exist just move HEAD one commit back. You could even get the changes back by merging the "bad" commit back without committing the merge (using the `--no-commit` switch).
That Git is able to handle even completely weird requirements, like making history disappear?