The highest-ranking ancestor which I am aware of is a 4th great-granduncle, Captain John Guynes of the 22nd Texas Infantry.
Prior to being expanded into a regiment, the unit had been the 5th Texas Infantry Battalion, of which Guynes had been captain of the battalion's Company B. When the battalion was expanded into the 22nd Texas, Company B was re-designated as Company F, and Guynes served as captain of the company for the majority of the regiment's service. As part of John G. Walker's Texas "Greyhound" Division, the regiment served in numerous campaigns in Arkansas and Louisiana, including the battles of Mansfield, Pleasant Hill, and Jenkins' Ferry.
In the autumn of 1864, rumors that the division would be crossed across the Mississippi were abound, and Guynes was alleged to be expressing sentiments "persuading and advising soldiers to desert." The resulting court-martial found Guynes guilty of the charges, and he was executed on October 16th, being one of the few officers sentenced to an execution during the war.
Additionally, he is the only ancestor in my lineage who was a Mexican War veteran, having served in the 1st Battalion of Mississippi Rifles, a unit which did not see combat, but was present in Mexico, albeit in garrison duty.