The double surgeon's knot works for me. For pulling a fly out of a tree, it's a toss up on what will break first. Hopefully, it's somewhere in the tippet or leader and not the rod. I've had the DS knot hold and the break occurred at the fly.
I figure once it's in the tree, it's lost. If the surgeon's knot holds, I usually have to trim off what's left of the tippet to put on a proper length of new tippet anyway.