It really depends on the situation. If you are solving an equation $x^2=a$, then you need to consider both real square roots (ignoring complex roots). If you have $x=\sqrt{a}$, then you are specifying the positive root.
For complex roots, you have to use a different convention to specify which root you want to take. Maybe by convention, take the root with the smallest angle to the real axis?
But to answer the question: if $-x$ is a complex number, then $\left(\sqrt{-x}\right)^2=-x$ since by definition, you squared the square root of a complex number. This should be true regardless of what root you take: $\left(\sqrt[n]{z}\right)^n=z$. Of course, you always have the freedom to change the angle by $2\pi$, i.e. $z=|z|e^{i(\theta+2\pi k)}$ for any $k\in\mathbb{Z}$. I figure by convention, it makes sense to choose $k=0$ when allowed to do so.
As an example of the positive square root convention, consider the quadratic equation:
$$x=\frac{-b\color{red}{+}\sqrt{b^2-4ac}}{2a}.$$
This is automatically only one specific solution to the equation $ax^2+bx+c=0$. You have to change the "$\color{red}{+}$" to a "$\color{red}{-}$" in order to get the other solution.
Sometimes I've seen expressions such as $x=\mp \sqrt{a} \pm \sqrt{b}$. In this case it truly matters how you take the square roots as you only have $x=- \sqrt{a} + \sqrt{b}$ and $x=+\sqrt{a} - \sqrt{b}$ ("$+$" sign unnecessary to specify the positive square root on the latter). You cannot just arbitrarily choose which root to use!