I have a master (main) branch  and a develop branch with another code.
We realized that all the code from the master is obsolete and should be entirely replaced by the the develop branch (clean develop, without any additional master files, any merge).
master should remain the main (production) branch
Automatic merge failed because of conflicts.
Edit: after Eric's sugestion I did the following
git checkout master
git reset --hard develop
git push --force
And obtained:
fatal: You are not currently on a branch. To push the history leading to the current (detached HEAD) state now, use
git push origin HEAD:<name-of-remote-branch>
and this



 
    