I have a master branch. On some t
day I merged new files to the master, but realised that these files caused some bugs. I created a new branch (from master), in this branch, I deleted all the changes of the previous commit and committed it to master. Things go as usual, and there has been few more unrelated commits to master. Today, I realised that the issue was not caused by all the files, but only a small bug fix. So, I am trying to bring back all those files (along with bugfix), but unable to do so. I was thinking if I create a new branch from the point when I committed those files originally, I would get back the files, but it just shows up as a blank branch (no changes) when I try to merge to master?
I am sorry, I am not that familiar with git here. My most of the use has been limited to just git pull
and git push
. Can someone please help me understand what I am doing wrong?
So... suppose you have this:
So, what you can do is, first:
With that, you get:
Now, let's cherry-pick the original commits of
feature1
:Now, you have this (not ordered chronologically, anyway):
And to git,
blah
has not been merged intomain
even though it is equivalent tofeature1
. If you mergeblah
, it should be fine.