Git checkout to branch not showing correct versions of files
I have a repo with 3 branches: master, Stable, and dev. I made a lot of changes on the dev branch and committed them. My colleague then checked out Stable branch over the top and created a tag.
When I switched back to the dev branch the files have reverted to 开发者_JS百科an older version. When I check git log I can see all the commits I made with the correct files. There are no commits on the dev branch that suggest code has been merged back.
Is it possible to get back the files or will I have to redo the whole lot?
Not really a solution here, but what I use with this kind of problems is gitk or some other git GUI.
You say you can see the commits when you do git log
, can you see the commit-ID ? You can always use that to checkout... at least to make sure nothing is lost.
You should be able to find the commit references of your lost commits with "git reflog" then you can cherry-pick them.
精彩评论