anderson then fought at the battle of cold harbor in early june, and participated in the rest of the army of northern virginia's operations to the south of petersburg, virginia, from mid-june until october. anderson was promoted to temporary lieutenant general on may 31.