How to fix fatal: Cannot switch branch to a non-commit in Git | DevErrors