Aborted old git rebase and lost commits since the rebase started

前端 未结 2 1774
野趣味
野趣味 2021-01-30 10:08

Crap! About a week ago, I was rebasing some commits while trying to clean up my repository, and apparently I didn\'t actually finish it. Today, a week and several commits later,

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 10:40

    Check git reflog. You can walk back in time using those commit hashes as a reference in almost all cases.

    I'd also physically copy the git repo directory elsewhere as a place to do preliminary testing to see what will work, that way you can mess with whatever you want without losing untracked files or getting things into a state that you can't come back from.

提交回复
热议问题