During both the Korean War and the Vietnam War eras, many soldiers enlisted after being given a choice by a judge: Join the military or go to jail. Today, the military will not allow anyone who has been convicted of a felony to enlist unless under special circumstances, but this controversial practice dates back to the Revolutionary War.
This was most common within the British, who often coerced soldiers fighting for the colonies to their side once captured, as happened to John McClain of Harford County, who was compelled to join after being captured during the Battle of Brooklyn on August 27, 1776.
However, American forces also used this practice. This can be seen in the case of Private Elisha Everit. After enlisting into the Continental Army’s First Maryland Regiment on March 11, 1776, Everit served for about ten months. A majority of his service was spent in and out of the hospital: all of the muster rolls that show him list him as sick. After being discharged that December, he chose not to reenlist and instead began to live as a civilian once again. Although it is not known why Everit had originally chosen not to reenlist, it was possibly due to personal health reasons.
However, when he was arrested for stealing a horse one night two years later in Montgomery County, Everit was given two choices: face prosecution or reenlist into the Continental Army once again. Everit continued to serve for the next few years, eventually being discharged in 1779 after an exchange for another solider.
The most interesting thing about Everit’s case is why he was offered this rare choice. As Thomas Paine feared, not all soldiers were heroic; there were soldiers who were cowardly and shrank from duty. George Washington often spoke out against his troops stealing or misbehaving, once stating that soldiers who acted out would “pay the forfeit of their crimes” as “pity under such circumstances would be the height of cruelty.” The question is, why was a soldier like Everit given the option to reenlist for stealing one horse while, for example, a foragemaster named Ewing was dismissed from the service in 1781 for having three stolen horses? 
Very little information that could answer this question is known. As Everit reenlisted rather than stand trial, no records of his case exist except for a letter written discussing his decision. In the case of Everit, it was possible that the judge and other involved members were trying to put Everit back on the right track. He didn’t have a written history of crime while serving, and the idea that military service could teach one discipline is still alive today.
No matter the reason, Everit can still be looked at as one of the first cases of military service being offered as an alternative sanction in American history.
You can read Elisha Everit’s full biography here.
 James C. Neagles, Summer Soldiers: A Survey and Index of Revolutionary War Courts-Martial (Salt Lake City, UT: Ancestry Incorporated, 1986), 1, 9, 131.