I'm not sure how to do this but I gave it a try:
I know that $7$ must have an inverse because $\text{ gcd }(12,7)=1$
Now, on this, use euclidean algorithm. We have $$7x \equiv 1 \text{ mod } 12$$
$$x \equiv 7^{-1}(\text{ mod } 12)$$
So
$$12 = 7 \cdot 1+5$$
$$7=5 \cdot 1+2$$
$$5=2\cdot 2+1$$
Now we can stop this here and write:
$$1=5-4$$
And now I cannot replace $4$ because there isn't any $4$ in the equations above : /
What to do? There is another, easier way?