This guide provides a solution for users who need to combine (squash) multiple commits into a single one after they have already been pushed to a remote repository.
Important: Rebasing pushed commits changes the history. Do not follow this guide if you are working on a shared branch that others have pulled from, as it will break their history.
Before anything else, here's the part that I always rely on, so I will just copy and paste it, then explain it;