I have a beginner question around git and GitHub i was hoping someone could help with.
I have accidentally committed a change in piece of code that contains credentials on my local private repository on my local machine.
My pseudo commit history looks like the below and i am using the desktop application for GitHub to make these commits. I made the mistaken commit at id 3 but then all my other commits from four to seven are a big body of work and I do not wish to lose them.
Since this is my own repository the quick method might be to simply copy out the files i changed and revert back all my changes to id 3 and then copy in my good changed files. I was wondering if there was a better Git
way
commit first change id 1
commit second change id 2
commit third change id 3 - here is where the password was committed
commit first change id 4
commit second change id 5
commit first change id 6
commit second change id 7
Thank you very much for your time