This example uses Visual Code and Gitlens but the principles should be applicable in other tools. When multiple users are using the same repository code branch, it is common to encounter situations where there are conflicts in code between your local repository and the remote repository on GIT server. Below are 2 ways to resolve this:
Revert, pull and apply changes
Revert all your local changes and re-apply the changes after retrieving the latest changes from the remote repository branch.
$ git stash pop # applies changes and remove stash $ git stash apply # OR applies changes but keep stash
Commit, pull and merge
Commit all your local changes and pull the latest code from the remote repository. This will raise conflicts that you have to resolve before your code can be merged and sync back to the remote GIT server.
$ Stage and commit changes (locally) $ git pull # pull changes, resolve conflicts and commit changes