How are the limits of this integral transformed? 
Using $$\ln(x) = \int_1^x \frac{1}{t} dt$$
Show that for $x > 0$, $\ln\left(\frac{1}{x}\right) = -\ln(x)$

I am following a provided answer and didn't quite understand the following transformation and why/how it is done:
$$\ln\left(\frac{1}{x}\right) = \int_1^{\frac{1}{x}} \frac{1}{t}dt$$
$$~u = \frac{1}{t}, du = \frac{-1}{t^2}dt$$
$$= -\int_1^{\frac{1}{x}} t\frac{dt}{t^2}$$
$$=-\int_1^x \frac{1}{u}du$$
$$= -\ln(x)$$
I don't understand how the limits of integration were changed in the $2nd$ and $3rd$ term (from $\frac{1}{x}$ to $x$). Is there a property that makes this correct or is there some other reasoning behind the change? 

\begin{align}
\ln\left(\frac{1}{x}\right) & = \int_1^{\frac{1}{x}} \frac{1}{t}dt &  & {\text{Replace $x$ by $\dfrac1x$ in the definition}}\\
u & = \frac{1}{t} &  &{\text{This is the substitution you are making}}\\
du & = \frac{-1}{t^2}dt & &{\text{This is because }\dfrac{du}{dt} = - \dfrac1{t^2}}\\
\ln\left(\frac{1}{x}\right) & = \int_1^{\frac{1}{x}} \frac{1}{t}dt & = \int_1^{\frac{1}{x}} -t \times \left(-\frac{1}{t^2}dt \right) & \text{Multiply and divide the integrand by $-t$}
\end{align}
In the above integrand, we can replace $-\dfrac{1}{t^2}dt$ by $du$ and $-t$ by $- \dfrac1u$.
Note that we are making the change of variable, the integrand is in terms of $u$ now. 
Hence, we need to look at the limits for the variable $u$ in the integral.
We have the transformation that $u = \dfrac1t$. Hence, if $t$ goes from $1$ to $1/x$, then $u$ goes from $1$ to $x$. This is because when $t=1$, $u = \dfrac11 = 1$. Similarly, if $t = 1/x$, then $u = \dfrac1{1/x} = x$.
(For example, if $t$ goes from $1$ to $2$, then $1/t$ goes from $1$ to $1/2$.)
Hence, we get that
\begin{align}
\ln \left( \dfrac1x\right) & = \int_1^{\frac{1}{x}} -t \times \left(-\frac{1}{t^2}dt \right) & = \int_1^x \left(-\dfrac1u \right) \times du = - \int_1^x \dfrac{du}{u} = - \ln(x)
\end{align}
where the last equality is obtained since we have defined $\ln(x)$ as $\displaystyle \int_1^x \dfrac{dt}{t}$.
