我搞砸了我的应用程序,卷取做混帐,如何覆盖提交
git checkout <commit number>
报复,我想待的地方。
当我做了git的地位,它说
Your branch is behind 'origin/master' by 5 commits, and can be fast-forwarded.
我想我是5号从我的最新承诺。有没有办法让我的第5次从最近的一次提交我最近的一次?几乎可以覆盖或丢弃我的前四次提交中的所有内容?
UPDATE。
我做了
git reset --hard <commit number>
,但我怎么能推到我的仓库?它说...
To prevent you from losing history, non-fast-forward updates were rejected
我不想执行合并,我非常想消灭我的最新的4款
感谢
可能重复[你如何回滚(重置)git仓库到特定的提交?](http://stackoverflow.com/questions/1616957/how-do-you-roll-back-reset-a -git-repository-to-a-particular-commit) – Basilevs