After his failed raid, Stoneman was removed from command of the Cavalry Corps in the Army of the Potomac, being succeeded by Pleasonton. When the corps was reorganized later that month, Gregg took command of the new second division, mostly composed of his old division, the third. This new organization included the 8th Pennsylvania. Huey, meanwhile, had been promoted to colonel of the regiment on June 25, 1863. Huey took command of a brigade under Gregg in time for the Gettysburg Campaign. He was on detached duty during the Battle of Gettysburg protecting supply trains in Maryland, but he participated in the pursuit of the Confederate army. The brigade served under Hugh Judson Kilpatrick, not Gregg, during the pursuit.