 He was elected captain in the 6th Georgia Infantry on May 27, and assigned to command of the regiment's Company C. That October he led the forces guarding Choctaw and Owen Bluffs in Alabama.Anderson participated in the Maryland Campaign in the fall of 1862, fighting during the Battle of Antietam on September 17.In the fight he was wounded and captured by Union forces, and exchanged later that year.