[git] master branch and 'origin/master' have diverged, how to 'undiverge' branches'?

git pull --rebase origin/master 

is a single command that can help you most of the time.

Edit: Pulls the commits from the origin/master and applies your changes upon the newly pulled branch history.