| Start |
|---|
| Recovering from a bad rebase Suppose that you had started an interactive rebase: and by mistake, you squashed or dropped some commits that you didn't want to lose, but then completed the rebase. To recover, do In this case, the last commit, You can then create a new branch at that commit with RemarksGit's reflog records the position of HEAD (the ref for the current state of the repository) every time that it is changed. Generally, every operation that might be destructive involves moving the HEAD pointer (since if anything is changed, including in the past, the tip commit's hash will change), so it is always possible to revert back to an older state, before a dangerous operation, by finding the right line in the reflog. Objects that are not referenced by any ref are usually garbage collected in ~30 days, however, so the reflog may not always be able to help. |
Read Article
https://develop.horje.com/learn/1434/reference