All of your commits are available until you push your local branch to the remote repository. In other words, you can work on your local branch at your own pace without affecting other team members.
When you push your local branch to remote, Git will do a fast-forward merge to the destination repository.
However, if the push results in a non-fast-forward merge, Git will decline your push to prevent you from overwriting previous commits. In that case, you must pull the latest remote changes and push again.
You must not overwrite or change commits that have already been committed to the remote repository. Doing so will cause other team members’ local repositories to diverge from the remote repository.