Don't worry, your commits are still there, the message might be the same but the commits are not the same. So the commits you're seeing right now are a duplicate (different hash) of the ones hidden.
I suggest using git reflog to go over ur old commits one by one like this:
Step 1:
git reflog
you will have a list of commits like this:
53bc8bb (HEAD -> dev) HEAD@{0}: reset: moving to HEAD 53bc8bb (HEAD -> dev) HEAD@{1}: reset: moving to HEAD 53bc8bb (HEAD -> dev) HEAD@{2}: checkout: moving from using-dagger to dev 32f3ca8 (using-dagger) HEAD@{3}: reset: moving to HEAD 32f3ca8 (using-dagger) HEAD@{4}: checkout: moving from dagger2 to using-dagger e9058fd (dagger2) HEAD@{5}: reset: moving to HEAD e9058fd (dagger2) HEAD@{6}: commit: Imported dagger dependencies b094ab7 (origin/master, master) HEAD@{7}: reset: moving to HEAD b094ab7 (origin/master, master) HEAD@{8}: checkout: moving from using-dagger to dagger2 32f3ca8 (using-dagger) HEAD@{9}: checkout: moving from dagger2 to using-dagger b094ab7 (origin/master, master) HEAD@{10}: checkout: moving from master to dagger2
Step 2:
Lookup a commit that you doubt is your checkpoint
Step 3:
you will find your old commits here, if u wanna test them just do this:
If you doubt that b094ab7 is your commit then:
git checkout b094ab7
you will have HEAD detached at b094ab7 but it's ok, just do git log and check your commit history to make sure that your commit is the one you want, if that's it, if this is where you wanna be, then git reset --hard b094ab7 Other wise, repeat Step 1 until you find your checkpoint.
Once you find your checkpoint, you have your commits above (the duplicated ones you showed us), so just cherry-pick each one like:
git cherry-pick <hash>
and you're done
5fec811, that is the corrected "nuevo layout" commit. The older33b987dstill exists on your machine, and you can confirm that by examining the reflog, but it is not the parent of your branch head so it doesn't appear in the pick list. (And by the way, if you proceed to rebase, you will create another set of new commits.)