Sometimes I change my local files and screw things up.
It would be nice if I could revert back to a previous git commit I pushed to my remote repository (GitHub or GitLab).

I want to overwrite all my local changes.

Here's one way you can do that:

 git fetch origin
 git reset --hard origin/master

You can read about the commands and what they do on StackOverflow.