With interactive rebase you can squash multiple commits in to one commit and edit commit message
As an example if you want to squash these commits in to one commit using git squash with interactive rebase

Initially start interactive rebase including 3 latest commits with command
git rebase -i head~3
Then the default editor opens the latest 3 commits

Next edit rows you want to squash to start with “squash” and close editor

The commit messages of the squashed commits open in the editor

Then edit message and close editor

Commits are squashed in to a single commit

Finally push the branch to the remote with force
git push origin feature -f