'How to merge deleted folder back to main

I am having a school software project, my teammate accidentally deletes the Front-end(web) folder on the main branch, while deleting it on the back-end branch. We are trying to merge the web branch back to main, we merged web to the copy of mainhttps://github.com/siiulan/EasyQ/tree/copy_main/Frontend/EasyQ/public but the git failed to recognize the right folder, after the merge, the back-end code flows into the front-end folder, and what was in the web failed to get merged into the main. here is our git repository https://github.com/siiulan/EasyQ/tree/main/Frontend/EasyQ, can someone tell me what's happening, and how to fix it?

git


Solution 1:[1]

you should normally be able to :

  1. checkout to the commit before the mistake of your mate using checkout "hash of commit"
  2. create a new branch out of that commit using git branch
  3. merge the new branch with the main, to get back to a previous state.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman