You can leave at the current location (with changes) a new branch:
git checkout -b branch1
... and only push it .
git push -u origin branch1
Yes, the changes will be visible if the old master on the server.
At this stage, you can already do pull request.
But the local master should be rolled back to the state on the server in order to avoid surprises during further work. This can be done at any time, but the best thing is after sending branch1 to the server, so as not to lose anything.
git checkout master git reset --hard origin/master
The last command forcibly hangs the master branch at the specified point ( origin/master ). In this form, it is relatively safe, because the story does not correspond, but slightly moves into the past.
But in general, it can easily do things and lose new commits. Therefore, it is a good habit to leave in place, from which the branch is removed, another, spare branch. Here it is already done: just there lies branch1 .