Solved it, here is how.
For reference, the last commit in common between the remote master and my local master will be named A.
First reset the local commits and stash them :
git reset --mixed A
git add .
git stash
Then pull the remote master :
This causes no merge conflict as the local branch is now only behind the remote master.
git pull
Revert the 4 unwanted commits :
Multiples methods available, I used checkout to commit A.
git checkout -f A -- .
Commit & push to remote :
git commit -m "Revert to commit 'A'"
git push
Restore local commits stashed before the operation :
git stash apply
git add .
git commit -m "Local commits"
git push
Feel free to edit to improve this method.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…