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 in Montgomery County, Maryland two years later, Everit was given two choices: face prosecution or reenlist into the Continental Army once again. He chose the army, and went on to serve for another year although not very usefully. He was often too sick for active duty, and in the summer or fall of 1778, Everit deserted again.
Charles Greenbury Griffith, a Montgomery County militia officer charged with locating deserters, found Everit but was reluctant to send him back to the army. Griffith wrote, “I am at a loss what to do with [Everit]. He is a worthless fellow and I am fearfull will never render the publick much service. He is begging and praying to get released from the service and has offered a man in his stead that I think will make a better soldier than himself.” Eventually, Everit was sent back to the army, but on April 18, 1779, he was finally given permission to furnish a substitute, a man named Jefferson.
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. It is possible that the judges 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. They may also simply have desperate to for men to fill the army’s ranks.
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.