0

I have 4 branches on my repository: project1, project2, project3 & gh-pages

All project branches merged into the gh-pages and have their own folder there

After I merged project3 into the gh-pages I did some changes to project3 files being on gh-pages branch.

After that I returned on my project3, made few changes & push to project3 remote. When i wanted to merge project3 into the gh-pages i've got conflict, resolve it, but after this somehow gh-pages merged into project3 and now I have all folders (project1, project, project3) on my project3 branch. I did fetch, pull and delete this folders from my local project3, commit this changes to my remote project3 and now if I merge project3 to gh-pages this is going to delete project1 and project2 folders on gh-pages

What should i do?

  • 1
    This is not helpful to you, but to me your setup looks like something I have never seen. Why is it important that each branch only contains one of those projects? – Antti_M Oct 16 '20 at 08:50
  • 1
    I would recommend not using branches as a means of managing different projects. – evolutionxbox Oct 16 '20 at 10:01

1 Answers1

0

You can git reset --hard 123abc your project3 branch to the commit before the accidental merge, and git push -f.

Be careful to check the state you are pushing to not lose anything!

This answer is more extensive: https://stackoverflow.com/a/5816761/3280244

Antti_M
  • 904
  • 10
  • 20