I was about to check in some code to git hub using the UI client when I got some issue with a detached head. I am using the client, and I’m not familiar with the git shell. Before me, another developer checked in some code to the master, and afterwards I tried to check in my code, and got the issue.
It never happened before and I was able to always commit and sync changes. Then suddenly it came up when the other person committed changes before me. Besides new code, nothing else changed on my end.
Also, I have the below error.

Is there any simple, easy, quick way I can get rid of this detached head thing and get my code onto the main branch?
The OP Frank solved it the “quick” way:
You seem to have two issues:
In both cases, opening a shell is advisable.
And backup your git repo first, in order to start over if those solutions don’t work.
For the detached HEAD, following “Git: How can I reconcile detached
HEADwithmaster/origin?“:For the push:
If you still have a “Failed to load commit history” error message, check the GitHub GUI log.