I have deployed flask on heroku
I need to modify the code and resubmit it. I mistakenly switched the path to another folder and submitted the master branch of this wrong folder to the remote library
The command is git push heroku master
And I switched to the correct code folder and then submitted it, the prompt
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/hulumei.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
If I use git pull, the error code of the remote warehouse is merged with the local code. Then I use the git reset --hard version number command to roll back to the correct node, and then submit it to the remote library, but the above prompt is still there. Information
Can you please give me an answer? Thank you
If you can confirm that the code of your current branch is correct.
Undo remote recording
git reset --hard HEAD~1
#Undo a recordgit push -f heroku HEAD:master
#Sync to remote warehousegit undo remote records