The soldier in question had been sick and sent home on furlough. Apparently the last location for his command that he could identify was Cold Harbor VA, where the Army of Northern Virginia was in line from June 3-13, 1864. He may have heard someone mentioned that while in the hospital at Richmond VA.
By the time the soldier came home in early July of 1864, Cherokee County was behind Federal lines. No concern about local home guards, but soldiers were busy rounding up all men found in the area. So this man was either picked up or decided to be safe and turn himself in the Federal authorities.
Any soldier not returning from leave would be considered a deserter. Federal authorities were willing to let deserters go as long as they took the Oath of Allegiance and swore to remain north of the Ohio River during the war.
By the way, language later used for the Pledge of Allegiance was modeled on the Oath of Allegiance taken by Southerners and others having Southern sympathies.