It is actually part of a common workflow with GitHub. Commit locally often. Push to a working branch on a personal fork often. Reorganize, squash, rebase, locally then git push --force-with-lease the result you want in a pull request onto your branch before sending it back to the parent project.
git push --force-with-lease
Had to look that up. For those unfamiliar: git push --force-with-lease
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.