After his resignation from the army, Deshler enlisted as a captain in the artillery. In September 1861 he was an assistant to Brigadier General Henry R. Jackson during the Battle of Cheat Mountain. Deshler was wounded at the Battle of Allegheny Mountain when he was shot through the thighs. After his recovery from his wounds he was promoted to colonel and assigned to the staff of Maj. Gen. Theophilus H. Holmes. In 1862 he was given his first command, which consisted of the 10th Texas Infantry Regiment, and the dismounted 15th Texas, 17th Texas, and 18th Texas Cavalry Regiments. On January 11, 1863, Deshler was captured when the Confederates surrendered at the Battle of Arkansas Post. After being exchanged he was promoted to brigadier general on July 28, 1863.