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:

git bisect.

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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -