What is the principal root of $\sqrt{-i}$? Where is the mistake in this solution?

$$\sqrt{-i}=\sqrt {\cos \frac{3 \pi}2+i\sin \frac{3 \pi}2}=\cos \frac{3 \pi}4+i\sin \frac{3 \pi}4=-\frac{\sqrt 2}2+i \frac{\sqrt 2}2$$

WA gives me different result:

$$\frac{\sqrt 2}2-i \frac{\sqrt 2}2$$

Why the principal root must be equal to $\frac{\sqrt 2}2-i \frac{\sqrt 2}2$?
I used Moivre's formula. But I dont know. How can I must choose value of $k$ in Moivre's formula? I chose $k=0$.
$$z=r\left(\cos x+i\sin x\right)$$
$$z^{\frac 1n}=r^\frac1n \left( \cos \frac{x+2\pi k}{n} + i\sin \frac{x+2\pi k}{n}\right)$$

Since you are asked to find the principal root, you need to solve according to the definition of the principal root below.
Given the complex number $z$,
\begin{equation}
z = r \mathrm{e}^{i \theta},  ~ -\pi < \theta \le \pi.
\end{equation}
its principal square root is defined as,
\begin{equation}
\sqrt{z} = \sqrt{r} \mathrm{e}^{i \theta/2}
\end{equation}
Note that $\theta$ is expressed within $(-\pi, \pi]$. In your case, $z=e^{-\frac{\pi}{2}i}$. Thus, its principal root is 
$$e^{-\frac{\pi}{4}i}=\frac{\sqrt 2}2-i \frac{\sqrt 2}2$$
as given by WA.
