Going back in time with Git
July 23, 2019 —
Cédric Dekimpe
Let’s pretend you want to initiate a git bisect
because someone (obviously you) introduced a bug in your code base. Once you launched the first git bisect bad
, you have to go back in time to find a state of the code where the bug was not present and mark it as git bisect good
.
You could find your way to a commit where the code was good with a bunch of git log
and git checkout
, but if you know when the code was right, you can use this syntax :
git checkout '@{10 days ago}'
You’re welcome, future me.