General Anderson resigned his army commission on July 19, 1862, and served the Confederate war effort in the Ordnance Department until the evacuation of Richmond on the night of April 2–3, 1865. As the retreating Confederate troops burned many of the munitions dumps and industrial warehouses that would have been valuable to the North, Anderson reportedly paid over fifty armed guards to protect the Tredegar facility from arsonists. As a result, the Tredegar Iron Works is one of few Civil War era buildings in the warehouse district that survived the burning of Richmond.