我弄糊了我的应用程序,最终做了一个
为了回到我想要的位置。 当我执行 git status 命令时,它会显示:
我猜我距离最新提交还有5个提交。有没有办法让我最近的第5个提交成为最新的提交?基本上是覆盖或丢弃前4个提交的所有内容?
更新。
我执行了一个
但是我该如何将代码推送到我的仓库呢?它提示...
git checkout <commit number>
为了回到我想要的位置。 当我执行 git status 命令时,它会显示:
Your branch is behind 'origin/master' by 5 commits, and can be fast-forwarded.
我猜我距离最新提交还有5个提交。有没有办法让我最近的第5个提交成为最新的提交?基本上是覆盖或丢弃前4个提交的所有内容?
更新。
我执行了一个
git reset --hard <commit number>
但是我该如何将代码推送到我的仓库呢?它提示...
To prevent you from losing history, non-fast-forward updates were rejected
我不想执行合并操作,我实际上想要清除我最近的4个提交记录。
谢谢。