Detaching group items

I used the add child code, but I can’t detach group items.