When you are working with a Gitlab or Github you can run in trouble in this way. You squash your commits with one of the above method. My preferite one is:
git rebase -i HEAD~4
or
git rebase -i origin/master
select squash or fixup for yours commit. At this point you would check with git status. And the message could be:
On branch ABC-1916-remote
Your branch and 'origin/ABC-1916' have diverged,
and have 1 and 7 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
And you can be tempted to pull it. DO NOT DO THAT or you will be in the same situation as before.
Instead push to your origin with:
git push origin +ABC-1916-remote:ABC-1916
The + allow to force push only to one branch.