A judge ruled the Justice Department abruptly sent Cohen back to prison as retaliation for a book he wrote about President Trump.