I am a sole developer for a web application. Every day I use a scheduled task to add a new commit and push to the master branch (I.e. git add . & git commit -m "scheduled commit" & git push)
I use this mainly for keeping backups/version history each day in case I ever need to revert.
I am having a major problem with my codebase that I can't find the error for and so would like to revert back 20 commits from the remote master branch yet keep the history of the commits so that I can slowly add back the code ensuring the error does not return.
I have done git reset --hard {hash} which has put the header back 20 commits. How can I now merge this as a new commit?
Git pull/push will fast-forward these extra 20 commits. I don't want to do this. I want the code exactly as it was 20 commits ago as a new commit and as the latest commit.
git checkout doesn't work as it says I am behind 20 commits.
git checkout {hash} puts me in headless mode - I am not quite sure what this means.