Resolve detached head