This question is primarily terminology based. In that $\sqrt{}$ denotes the principal square root. Here are two reasoning
$\sqrt{(-1)^2}=1$ since $\sqrt{(-1)^2}=\sqrt{1}$ which we know has a principal square root of $1$.
Or $\sqrt{(-1)^2}=-1$ since $\sqrt{(e^{\pi i})^2}=\sqrt{e^{2\pi i}}=e^{\pi i}=-1$
Which reasoning is correct and why? Also if possible can you leave a source.