The car narrowly missed hitting a tree by inches.
Meaning: The car almost hit a tree, but it missed by a very small amount.
Choice of Words: Narrowly missed means to come very close to hitting or touching something, and by inches means by a very small distance.
Alternative Expressions
Related Expressions