Earlier quoted context omitted.
git checkout will also happily throw away local unstaged modifications, and I would argue that it is even more dangerous because I did not have to type "--hard" to shoot myself in the foot.
That does not sound right at all, I’m pretty sure there’s a warning when you try to checkout a branch that would override local unstaged changes. I might be wrong but I’d like some proof.
>git status
On branch feature/redacted
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: redacted.py
no changes added to commit (use "git add" and/or "git commit -a")
>git checkout . Updated 1 path from the index
>git status On branch feature/redacted
nothing to commit, working tree clean