本人用flask已經在heroku部署完成
我需要修改程式碼重新提交,誤將路徑切換另外一個資料夾,將此錯誤資料夾的master分支提交到遠端程式庫了
命令為git push heroku master
而我切換到正確的程式碼資料夾再提交,提示
! [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.
如果用git pull,則把遠端倉庫的錯誤代碼和本地代碼合併了,然後我在用git reset --hard 版本號命令回退到正確的節點,再提交到遠程庫,還是提示上面的信息
求大神解答?拜謝
習慣沉默2017-05-02 09:28:03
git reset --hard HEAD~1
#撤銷一筆記錄
git push -f heroku HEAD:master
#同步到遠端倉庫
git 撤銷遠端記錄