I used the 'GitHub desktop' to push the edited react files for a website to 'main branch'. But it first told me to pull a new branch created by another team member. So I pulled But I got an error telling me to merge the new branch with the main branch. So I ignored webpack files that are merge error files, and merged them.
But all of these were pushed to a new branch instead of being pushed to the main branch. And a lot of webpack errors occurred.
So I rolled back using 'git reset --hard HEAD~5..' until the latest push(previous merge and push). Even in the history, my push/merged history disappeared. But after a while, all the history was restored and remained. So the files I have in VScode now and the history left on the 'GitHub desktop' do not match.
Why is this problem occurring?
Is it supposed to be like this? Isn't it when we used 'git revert' that the history remains?
And I pushed the files to the "main branch", but why are the files pushed to the "new branch"?