Breckinridge had been transferred out of the theater again and Wharton assumed command of the division, with his brigade led by Col. Augustus Forsberg of the 51st Virginia. Over the next two weeks, Early and Sheridan took turns pursuing each other up and down the Valley, and the Confederates were reinforced by a division under Maj. Gen. Richard H. Anderson. Wharton's division led the pursuit of the Union back to Winchester, capturing about 200. The 45th Virginia was held in reserve with the rest of Wharton's Division during the Battle of Summit Point on August 21. The pursuit and counter-pursuit continued. On September 4, Wharton was ordered to Berryville and found Anderson's men engaged with the division of Joseph Thoburn of Sheridan's army. The 45th Virginia and the rest of the division took up a position on Anderson's left flank and secured it, while the Confederates drove off Thoburn's men. But during the battle, Sheridan had been able to draw up the rest of his army, so Early ordered the Southerners to take up a position on Opequon Creek south of Winchester. During August, Lee had lost control of the Weldon Railroad south of Petersburg as Grant extended his lines to the west. Anderson was ordered back to Petersburg with his men and Wharton's division was moved north of Winchester to defend the battery that would cover the movement on September 16. Sheridan ordered an all-out assault and caught Wharton's division well north of the town at 8:00 am. Around 11:00, cavalry under Brig. Gen. George A. Custer penetrated the line, but the Confederates eventually drove him back. The division was withdrawn to about a mile north of Winchester, to link up with the rest of Early's line, with the 45th Virginia's brigade on the extreme left flank. Wharton's division was the focal point of a charge by Thoburn's division of Crook's army, which the 45th Virginia and its division turned back with heavy casualties. Thoburn reorganized and kept up the assaults and was joined by Averell's cavalry, who managed to get behind Forsberg's brigade. The division broke, followed by the army, and the men of the 45th Virginia ran back through town while Averell's cavalry rounded up prisoners. At least five members of the regiment were killed and 79 were captured. Early drew a new battle line a few miles south at Fisher's Hill, with Wharton's division entrenched at the top, Forsberg's brigade connecting to the division of John B. Gordon.