當你不小心手殘來硬的git reset --hard HEAD^後,發現砍錯了,恢復不了怎麼辦?怎麼辦?!!!
你的救星來了!!! 請參考下面操作~~~
>> git reset --hard HEAD^ (向前砍一次commit,心淌血了T^T)
>> git reset --hard HEAD^ (向前又砍了一次commit,心又再一次的淌血T^T)
>> git log --oneline
c825428 [TMAC] refactor TMAC FSM to support RTS+CTS+DATA+BA
cbca69b [TMAC] 1.add info in TRxreq and TRxsts 2. add a simple FSM in PPU Conflicts: examples/wireless/throughput/omnetpp.ini src/linklayer/ieee80211/mac/TrxReq.msg
73727ff Handle SIFS TX Request within TXOP
>> git reflog (查看之前下的歷史紀錄跟當下的hash值)
c825428 HEAD@{0}: reset: moving to HEAD^ (發現這是你第二次砍完的版本)
6da934d HEAD@{1}: reset: moving to HEAD^ (發現這是你第一次砍完的版本)
1c0dbcc HEAD@{2}: rebase finished: returning to refs/heads/DEV_BR_802.11ax
恢復到你還沒砍之前的狀態
>> git reset --hard 1c0dbcc
HEAD is now at 1c0dbcc [802.11x][RMAC][Feature] receive the Radio state at RMAC and change message between RPU and CAU
所以你可以看到又多出兩筆先前commit的資料
>> git log --oneline
1c0dbcc [802.11x][RMAC][Feature] receive the Radio state at RMAC and change message between RPU and CAU
6da934d [802.11x][RMAC][Feature] Add the replyInterval in RxReq message
c825428 [TMAC] refactor TMAC FSM to support RTS+CTS+DATA+BA
cbca69b [TMAC] 1.add info in TRxreq and TRxsts 2. add a simple FSM in PPU Conflicts: examples/wireless/throughput/omnetpp.ini src/linklayer/ieee80211/mac/TrxReq.msg
73727ff Handle SIFS TX Request within TXOP
有沒有頓時覺得用git用得很開勳阿>///<
請大家繼續開心的寫程式唄!
傻孩子下台一鞠躬! <(_ _)>
這是我的工作酸甜苦辣,與大家分享,希望彼此都有收穫:) This is my working experience in my life. It is good to share with you :)
Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts
Tuesday, January 26, 2016
Sunday, May 10, 2015
Git command sets
This summary is not available. Please
click here to view the post.
Subscribe to:
Posts (Atom)