How to "rotate the phase"? I have problem, not sure how to call it but I think it's something called "phase rotating", but not sure.

I make fast Fourier transform on simply square wave, and then I make inverse fast Fourier transform - just for fun :)
and after this forward/backward FFT on square wave I expect on a wave graph something like that:


But I get that:


Could anyone help me, which parameter I should change, to fix it?
Ok I give the answer by myself, but it’s only half of answer. As I know we can rotate $ 90^o $ the phase by multiplying the wave by $ j $ - imaginary number. And to rotate it to $ 180^o $ we need multiply by $ j^2 $ (or just $ -1 $ which is the same). To rotate $ 270^o $ we need to multiply by $ j^3 $, and so on...

But if we want rotate something between? For example $ 45 ^o $ or $ 30^o $. What we need to multiply by?