He led the Union Army of the Potomac from the Battle of Gettysburg to the end of the Civil War . During the American Civil War he served as a Union general , rising from command of a brigade to the Army of the Potomac .