Alleged JPMorgan sex slave Chirayu Rana scored a major win in Manhattan court Tuesday when a judge said he could move his case from state to federal court — giving him a do-over after months of unfavorable rulings.

“Contrary to the defendant’s contentions, there have been no findings of fact to suggest that [Rana] has acted in bad faith, engaging forum shopping, or that he seeks to avoid an adverse ruling,” Judge Dakota Ramseur said.

But the 35-year-old former banker also suffered two blows.

His accused former supervisor, Lorna Hajdini, can now proceed with her related defamation claims against him in a totally separate lawsuit, meaning it is not beholden to his case — while her camp must be given the names of Rana’s previously anonymous witnesses and unredacted versions of their statements before discovery, Ramseur said.

The lawsuit included an explosive claim that Hajdini exposed her chest to him at one point while taunting, “I bet your little Asian, fish head wife doesn’t have these cannons.”

Rana originally filed his suit anonymously, but The Post exclusively unmasked him as the plaintiff — and he was eventually ordered by a judge to update his lawsuit under his real name.