Here is what I want to do. I want to go back to 2 commits before, bring back the files that changed in that commit as a new commit maybe. But I do not want to lose my last commit. My last commit has some mistakes in the code but I would like to keep that one for now.
I read some documentation but none made it clear about what happens when you reset your head. Do you lose all the commits up until the one that you are resetting to (going backward) for example?
I am trying to understand how all this works but I am rather confused about git revert
, reset
and checkout
commands.
I realize that I should have stashed the last commit instead of committing, but that is another story for now.