How do you free a child opbject from it's parent upon collision ?

My character is piloting an ATV . I want him/her to fall off during a crash .

void OnCollisionEnter(Collision col)
{
if(col.gameObject.tag==“xyz”)
ChildGameObject.transform.parent=null;
}