所以我对我的git repo做了一些修改并提交了它们。把它们放在服务器上,现在服务器崩溃了。我做了一个git reset很难得到早期的提交" 12345"。然后我找到了问题并修复了。所以现在我想回到最后一次提交" abcd"。
实施例
1st commit
....
commit "12345"
....
commit "abcd"
我做了重置难以" abcd"然后我修复了代码。但是现在当我试图推动时我得到了这个错误。
" ...阻止您丢失历史记录,拒绝非快进更新 在再次按下之前合并远程更改。 "
那么如何废弃所有东西并让本地和远程回来提交" abcd"?
=====更新===================
我尝试了git push,然后我得到了#34;一切都是最新的"。
更新:
好的,这是我提交的可视化图表
* 731e9 (HEAD, origin/beta-stag, beta-stag) <--- last commit HERE
* 5c82f More whitespace
* 8939c More whitespace test
* f3bd1 Added whitespace after git pull origin beta stag and then a git fetch. Now adding whit
* d2336 did a pull origin beta-stag as it will NOT let me pushbs
* 5a2f9 After reset hard. This commit is after I went to the end commit minus whitespace one. The
* 18393 Added whitespace to see if my revert will let me push
| * 36e9d0f (origin/beta, heroku/master, beta) removed assigned_dealer2_id
| * 75203 removed @ar.assigned_dealer2 refernces
| * 784a6 removed check for service tier
| * 77789 removed hidden field can not view call history
| * ee6d8 First commit not from beta-stag
| * 55905 Merge branch 'beta-stag' into beta
| |\
| | * cd7c4 Random changes
| * | e6d92 Merge branch 'beta-stag' into beta
| |\ \
| | |/
| | * 4dc81 (I NEED TO HERE!!! Damn everything else on origin/master)Changed dealer min to 1 for any high level deliveries like bolt
| | * d73f5 Added name so when dealer 2nd is selected we show by name not id
| | * f3afc Switched to dealer email in the 2nd dealer dropdown as some dealers have two phones.
........
1st commit here