I have created a branch branch1 from master.
created a file test1.txt in branch1:
test1.txt
some logic
Then I merged branch1 to master.
But I realized that the logic implemented in branch1 is not properly tested. So I have removed the logic in test1.txt and directly committed in master.
Now the file in master will be like this:
test1.txt
removed logic
Then I switched to branch1 and tested the logic. Since the logic looks fine, I didn't make any changes to the files.
When I tried to merge these changes to master, it shows the following message:
Already up to date.
How can I merge these changes to master?
There are several way to do this.
One of them is : on your master branch, revert the commit where you deleted the logic
git revert <sha1>
This will create a new commit, which re-enables said logic.
Or you can simply edit the file by hand, to reenable the logic (you may copy/paste the relevant chunk from the version in branch1), and commit on master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With