I stuck a pin through a carrot. When I pulled the pin out, *it* left a hole.

Do "the pin" and "it" have the same meaning?
yes