做了一个git重置,现在我不能推



在我执行了"git reset hard"&;回到以前的承诺?我在heroku上部署了一个站点,有些东西弄乱了我的代码,所以我只是做了一个"git重置",这是我从来没有做过的。我在VSCode上的代码回到了我想要的方式,但是当我尝试执行"git push origin master"或者"git push heroku master",它给我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 push -f origin master

如果你不喜欢强迫push到master,你可以创建一个新的分支来推送,然后合并或创建一个PR。

最新更新