He lost the Republican primary in his Northern Virginia district in June to David Brat, a little-known and more conservative candidate with Tea Party backing. The results shocked Washington and led to a shake-up in the House leadership after Mr. Cantor said he would resign as the No. 2 House Republican. He said he hoped to prevent an intraparty fight from festering in the months before the midterm elections.