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 commi
If you want to go back, say 2 commits previous, you can just do git checkout HEAD~2
. This will get you all as it was then. If you were on branch master
, git checkout master
will bring you back to the present. If, however, you want to keep the current state but start a new developemnt branch there, git checkout -b HEAD~2
will start a new branch there. In case you want to rewind master but not loose your current, unfinished/broken work, do
git branch wip # New branch ends a current tip
git reset --hard HEAD~2 # Old branch rewound, get files from then