When the American Civil War began in 1861, Anderson chose to follow his home state of Georgia and the Confederate cause. 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. Upon release Anderson was promoted to major, effective back to the date of the Battle of Antietam. That December he took part in the Fredericksburg Campaign. In 1863 Anderson participated in the Chancellorsville Campaign and was seriously wounded on May 3. He was hit in his shoulder, his abdomen, as well as his left hand, losing a finger in the process. On May 15 Anderson was promoted to lieutenant colonel, but due to his injuries he resigned his commission in the Confederate Army on January 20, 1864. Upon returning home to Georgia, Anderson was appointed aide-de-camp to Gov. Joseph E. Brown. During the summer of 1864 Anderson was appointed colonel of the 5thGeorgia Militia, and by May he was promoted to brigadier general and given command of the 3rd Georgia MilitiaBrigade. His force was sent to augment the Army of Tennessee following the Battle of Kennesaw Mountain in late June, and served throughout the remainder of the Atlanta Campaign. On July 22 in the Battle of Atlanta Anderson's command was only lightly engaged. When Atlanta fell the militia forces were detached from the Army of Tennessee and served during Sherman's March to the Sea that winter. He was part of the Confederate attack in the Battle of Griswoldville on November 22, where "Leading his brigade, Anderson had his clothes riddled with bullets and his horse was shot out from under him; his coolness and precision in that unfortunate battle were marked." Anderson was indeed wounded in this fight. Anderson and his force was part of the garrison defending Savannah, Georgia, in December 1864. Following the surrender of Savannah his militia brigade was ordered to Augusta, and his last assignment was to defend Macon. Although he did not know nor did he serve, Anderson had been elected to Georgia's state senate near the end of 1863, a term that ended in 1865 as the war came to a close. He also had been mustered out of the volunteer Confederate forces in January.
Postbellum career
After the war ended, Anderson remained in Macon, where he operated a cotton warehouse as well as a running a farm supply business, and he was pardoned by the U.S. Government on September 25, 1865. When both adventures failed he returned to Fort Valley, Georgia, where he was the tax collector of Houston County. He died in Fort Valley in 1901, and was buried in the city's Oak Lawn Cemetery.