To track down at which point I broke a feature in my software, I need to review older versions of my repository. I just want to set the working directory to an older commit, play with the code, afterwards discard the changes, and then try another commit.
I do not want to change anything about commits, neither remove nor create ones. I tried using
git checkout old-sha1 can be a start, but the real command for that kind of task is:
Find by binary search the change that introduced a bug
If you have a script able to test if your working tree "works" or not, you can execute that script on previous commits through
git bisect, locating the first commit which breaks your test.
Note that this command isn't yet supported directly by GitHub for Windows: you will have to open a shell.
git checkout would leave you in a detached HEAD, which doesn't matter since you won't make any modification.
To get back to were you were, checkout a branch:
git checkout master
See "Why did git detach my head?".