'How to update remote fork after a git reset --hard without closing upstream PR?

I have an upstream repo where I have opened a pull request which is still ongoing. In order to delete all my local changes to master branch, I did

git reset --hard upstream/main

as explained here. Now my local repo is updated with the upstream. I'd like my remote fork to be updated too, but since I read in the answer in the link that git push origin master --force will close my PR, I can't do that.

Therefore I have two questions:

  1. How can I update my remote fork?

  2. If now I create a new branch from master, say Hotfix, nothing bad will happen to my PR in the upstream, right?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source