If you notice that your git log shows that the HEAD still points to the bad commit, your commits are not lost; it’s just that the git bisect session has not ended yet.
Before git bisect:
git log --oneline
5220a3b (HEAD -> main) 10 document bisect goal
8513476 09 add production environment
d9ecdfa 08 add route placeholder
051ab2b 07 update home page copy
2ea59b6 06 upgrade Angular without Auth0 SDK
904820a 05 document project timeline
c1b8147 04 add environment config
b873da7 03 add home component
7adc7c4 02 add Auth0 Angular SDK
d128dce 01 create Angular 16 project
After git bisect:
git log --oneline
2ea59b6 (HEAD) 06 upgrade Angular without Auth0 SDK
904820a 05 document project timeline
c1b8147 04 add environment config
b873da7 03 add home component
7adc7c4 02 add Auth0 Angular SDK
d128dce 01 create Angular 16 project
Check if there’s an active session with git bisect log. If there is, it will show something like below:
git bisect log
git bisect start
# status: waiting for both good and bad commits
# good: [d128dceb479f86dc70592d0575ebef0c7ee8b582] 01 create Angular 16 project
git bisect good d128dceb479f86dc70592d0575ebef0c7ee8b582
# status: waiting for bad commit, 1 good commit known
# bad: [5220a3b13175b7bf4bb0653adfef83bfb6c9022a] 10 document bisect goal
git bisect bad 5220a3b13175b7bf4bb0653adfef83bfb6c9022a
# good: [904820a7ecd41b3201836584c7ae7e5cab6a0bb8] 05 document project timeline
git bisect good 904820a7ecd41b3201836584c7ae7e5cab6a0bb8
# bad: [051ab2bd4865dc24a136ddb401395d40b038c77b] 07 update home page copy
git bisect bad 051ab2bd4865dc24a136ddb401395d40b038c77b
# bad: [2ea59b614121aa89bcdf3d2e611cecc1dbdc3fe3] 06 upgrade Angular without Auth0 SDK
git bisect bad 2ea59b614121aa89bcdf3d2e611cecc1dbdc3fe3
# first bad commit: [2ea59b614121aa89bcdf3d2e611cecc1dbdc3fe3] 06 upgrade Angular without Auth0 SDK
Reset it with git bisect reset then check the log again. You should see We are not bisecting.
git bisect reset
Previous HEAD position was 2ea59b6 06 upgrade Angular without Auth0 SDK
Switched to branch 'main'
git bisect log
error: We are not bisecting.