How to fix fatal: Objects must be of the same type to be replaced in Git | DevErrors