I am cherry picking a commit from branch A into branch B. Branch A is many commits ahead of branch B, and I wanted to ignore a few previous commits in branch A and cherry-pick a future commit. For example, branch A has commits 1,2,3,4,5,6 and branch B has just 1,2 and I wanted to cherry-pick commit 6 from branch A into branch B. Turns out I did not realize that commit 6 changes a file introduced in commit 5(which branch B does not have). But on trying the cherry-pick of 6(to branch B), git did not show the file introduced in commit 5 as a conflict. I just lost the changes made in that file when I cherry-picked commit 6. Was that expected? Am I doing it wrong?
The command I ran was just "git cherry-pick <commit-id>"