I solved removing the last commit on my local develop branch (P2) with:
git checkout develop
git rebase -i HEAD~2
In this way I can do a simple fast forward on the develop branch
git pull upstream develop
Now I can rebase my patch branch, and eventually redo the merge.
git checkout patch
git rebase upstream/develop
git checkout develop
git merge --no-ff patch
I don't know if this is the best way to do it, so I am waiting to close the question.