I pushed my changes to my remote master branch by mistake. So to keep them safe I created a backup
branch. I then reverted the changes I did to remote master.
On my local master branch I ran:
git revert <commit_sha>
and then
git push
I have now finished working on the new branch (backup) and it all looks good. But I can't push the changes from my local backup
branch to remote master. When I run git pull
on my backup branch the changes I made are lost. The code is replaced with the contents of the remote master.
Is there a way for me to push my changes to the remote master branch without losing my work?
master
, or that you force push to the remotemaster
branch? – Doublecheck