SyntaxFix
Write A Post
Hire A Developer
Questions
The new git-switch command (starting in GIT 2.23) also has a flag --discard-changes which should help you. git pull might be necessary afterwards.
git-switch
--discard-changes
git pull
Warning: it's still considered to be experimental.