Some one merged a non working code into git and there were couple check-ins after that. I have two options, 1. To revert changes one by one and then when I reach good code, stop there. Option 2. Branch out the clean version using the checkin sha and make it the head. I see the question posted here and several other question. If I try option one, after couple resets when I try to reset next one I get:
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
Then I checked out the version I want to move to HEAD, and try to commit that. But I get this:
HEAD detached at 0c1b8c1
nothing to commit, working directory clean
When I try option 2 get the correct version of the code, but when I try to commit, it says nothing to commit. What's the best way to take an old version of the code and make it the latest and greatest in GIT? This is what I'm trying to do: