I have two branches that I'm working on: dev
, and test
. I made some changes in test
, and wanted to merge those into dev
. However, I only wanted to merge SOME changes to dev
, not the whole diff.
I could not cherry-pick commits, because that would have been too many.
What I did instead, was to checkout on dev
, then merge test
locally. I then staged and committed only the changes that I wanted to merge. The others, I discarded (which did not affect the test
branch).
Now I am ready to merge the other changes (that I previously discarded on local dev
, but which are still in test
) from test
into dev
. When I checkout on dev
again and then try to merge test
into dev
, it says "Already up to date".
I checked the source code: when checking out on test
, I see the method I've added. When switching to dev
instead, the method is not there (because it's not merged yet). When I switch back to test
, the changes are there again.
How is it possible that the merge does not include all changes I made?
Edit
I followed @Ôrel's advice from the comments and merged dev → test
, then test → dev
and now the previously discarded changes are gone from both dev
and test
. How do I restore them?