Say that there are some local commits(A, A1, A2, A3) on the current detached HEAD which points to commit A, after repo sync, the local detached HEAD is overridden with the remote latest detached HEAD which points to commit B, what's the best way to find the old commits(A, A1, A2, A3)?
What's the best way to find old detached HEAD after repo sync?
169 Views Asked by Chen Li At
2
The simplest way I can imagine is:
git reflogto find A:git switch -c branchname A, orgit rebase A/git merge A, then you will see allA, A1, A2, A3appear on the current HEAD once all conflictions(if any) are resolved, and don't forget to create a new branch withgit switch -c.