Man shot in head by police appears in court