 " Branch Wars " is the tenth episode of the fourth season of the American comedy television series The Office — the show 's sixty @-@ third episode overall . Written by Mindy Kaling and directed by Joss Whedon , the episode originally aired in the United States on November 1 , 2007 on NBC . The episode marks the return of season three regular Rashida Jones , who plays Jim 's former girlfriend Karen , now Regional Manager of Dunder Mifflin Utica . 
