Garfield proved himself to be a capable military commander, and demonstrated great courage and ingenuity. Once, when his brigade's supplies ran low, Garfield made the trip for food himself, and ferrying the food across a dangerous river by using his skills as a former canal boat worker.
Garfield marched his men south to dislodge the final remnants of Humphrey Marshall's forces, moving his men a grueling one hundred miles in only four days. After this exploit, Garfield's troops joined General Don Buell's army, and Garfield received command of the Twentieth Brigade. Buell's army was present at the second day of battle at Shiloh, one of the bloodiest battles of the war.
While the Union army rested after its heavy losses at Shiloh, Garfield received an order from the division commander to have his men hunt down a runaway slave believed to be in the area. Garfield refused to obey the order, despite the threat of a court-martial, arguing that neither he nor his men had joined the army to hunt slaves. In June, 1862, Garfield oversaw the rebuilding of the bridges on the Memphis and Charleston railroad and helped with the fortification of Huntsville; several colleagues observed that he displayed a surprising knowledge of engineering considering that he had never formally studied it. However, Garfield fell dangerously ill from malaria before the war progressed much further and returned to Ohio to recuperate.
When he returned home, Garfield found that he was a candidate for Congress in his district. Even though Garfield had sought neither the Republican nomination nor the seat in the general election, he handily won the November election. It would be a while, however, before Garfield actually took his seat in Congress. After recovering at home, Garfield served on a court-martial panel for the military in Washington, finding General Fitz-John Porter guilty of failing to support the commanding general at the Second Battle of Bull Run. While in Washington, Garfield reacquainted himself with former Ohio Governor Salmon P. Chase, now the Secretary of the Treasury. Throughout the years that followed and his later political career, Garfield looked to Chase as a mentor.
In January 1863, the Army ordered Garfield to Murfreesboro, Tennessee, where he served as chief of staff to General William S. Rosecrans. Garfield oversaw the training of Rosecrans's army and the two men became fast friends. When the days' work was finished, they often debated literature and religion late into the night. While fighting the forces of Confederate General Braxton Bragg in Tennessee, Rosecrans overadvanced and was forced to retreat, leaving the Union army of General George H. Thomas exposed. Garfield volunteered to carry the notice of the retreat to Thomas and rode through heavy enemy fire that downed two members of his party. Garfield arrived in time to save Thomas's force from being flanked and he was promoted to Major-General on September 19, 1863. Garfield would never use this commission, however, for President Abraham Lincoln, in need of intelligent and loyal Republican allies, asked Garfield to take up his seat in Congress.