In the military, desertion is the abandonment of a duty or post without permission (a pass, liberty or leave) and is done with the intention of not returning.

Under international law, ultimate "duty" or "responsibility" is not necessarily always to a "government" nor to "a superior", as seen in the fourth of the Nuremberg Principles, which states:

"The fact that a person acted pursuant to order of his Government or of a superior does not relieve him from responsibility under international law, provided a moral choice was in fact possible to him".

Although a soldier under direct orders, in battle, is normally not subject to prosecution for war crimes, there is legal language supporting a soldier's refusal to commit such crimes, in military contexts outside of immediate peril.

More Info: en.wikipedia.org