After going through github issues, I've found a commit that might be responsible for breaking code and I want to confirm this suspicion by doing something like:
git checkout --one-prior f1962b3cc771184a471e1350fa280d80d5fdd09d
To jump back to a previous commit, first find the commit's hash using git log . This places you at commit 789abcd . You can now make new commits on top of this old commit without affecting the branch your head is on. Any changes can be made into a proper branch using either branch or checkout -b .
Here you go:
git checkout f1962b3cc771184a471e1350fa280d80d5fdd09d^
Notice the ^
at the end. That means one revision behind.
For example this would be 5 revisions behind:
git checkout f1962b3cc771184a471e1350fa280d80d5fdd09d^^^^^
... equivalent to:
git checkout f1962b3cc771184a471e1350fa280d80d5fdd09d~5
Btw, when you do this, you'll be in a detached HEAD state. The output explains this, which is very interesting and worth reading:
You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With