git - How to set the working directory to an older commit? -
to track down @ point broke feature in software, need review older versions of repository. want set working directory older commit, play code, afterwards discard changes, , try commit.
i not want change commits, neither remove nor create ones. tried using git reset
after newer commit weren't shown anymore. downloaded repository again, because didn't know how revert that.
a simple git checkout old-sha1
can start, real command kind of task is:
find binary search change introduced bug
if have script able test if working tree "works" or not, can execute script on previous commits through git bisect
, locating first commit breaks test.
note command isn't yet supported directly github windows: have open shell.
a git checkout
leave in detached head, doesn't matter since won't make modification.
were, checkout branch:
git checkout master
see "why did git detach head?".
Comments
Post a Comment