Not quite:
"I, (NAME)(SSAN), having been appointed an officer in the Army of the United States, as indicated above in the grade of (Major) do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign or domestic, that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservations or purpose of evasion; and that I will well and faithfully discharge the duties of the office upon which I am about to enter; So help me God."
(DA Form 71, 1 August 1959, for officers.)
You are correct. However, it would be one heck of a stretch for an officer of the U.S. military, along with his men, to take that huge and irreversible step to willfully lead his unit into conflict against his own government and his once own military - that's a HUGE step. Btw, the U.S. military has a long tradition of faithfully serving it's civilian leadership and except for the American Civil War has never broke that tradition. As I heard Tom Clancy put it a few years back during a tv interview “the U.S. military is pathological when it comes to obeying their commander in Chief. I think he probably got it right.