Please edit the given paragraph to be coherent:
In 1862 he resigned. Then he joined Major General George B. McClellan in his siege of Yorktown.
In 1862 he resigned, but then he joined Major General George B. McClellan in his siege of Yorktown.