My sixth great grandfather was Edward Mainwaring (1709-1795),  who lived at Whitmore in Staffordshire.

Edward Mainwaring is mentioned in A Genealogical and Heraldic History of the Commoners of Great Britain and Ireland, Enjoying Territorial Possessions Or High Official Rank: But Uninvested with Heritable Honours, Volume 3, 1836 by John Burke republished as an ebook by Google at http://books.google.com.au/books?id=qf4GAAAAQAAJ.

Edward Mainwaring inherited, together with the possessions, the principles of his protestant ancestors, and signalized himself by his great zeal in repelling the invasion of Charles Edward in 1745, against whom he marched to Derby, at the head of his tenantry.  … (page 592)

The invasion of Charles Edward in 1745 is better known today as the Jacobite rising of 1745, or “The ‘Forty-Five”. It was the attempt by Charles Edward Stuart (1720-1788), the Young Pretender or Bonnie Prince Charlie, to regain the British throne for the exiled House of Stuart.

My great grand uncle James Gordon Cavenagh-Mainwaring (1865 – 1938) wrote a history of the Mainwaring family back to the entry of Whitmore estate in the Domesday Book of 1068. (Cavenagh-Mainwaring, James Gordon The Mainwarings of Whitmore and Biddulph in the County of Stafford. An account of the family, and its connections by marriage and descent; with special reference to the Manor of Whitmore. J.G. Cavenagh-Mainwaring, about 1935.) He says of Edward:

In the Scottish Rebellion of 1745, Edward Mainwaring showed great activity and marched at the head of his tenantry against the invaders. Ward in his “History of Stoke-upon-Trent” quotes a contemporary writer, who, in a letter to a friend in London, stated “I was at Whitmore with Squire Mainwaring, the day before Christmas Day, and he told me we had taken about a hundred of them and killed about thirty, and they had killed about ten of ours; and we look every day when the Duke overtakes the whole body of them.” (page 87) 

The history to which Gordon refers is probably John Ward History of the Borough of Stoke on Trent, Simpkin Marshall, London, 1838. There was also an edition published in 1843.

portrait of Edward Mainwaring (1709-1794) from The Mainwarings of Whitmore, opposite page 87

The Jacobites entered England on 8 November. They besieged Carlisle for two days until they surrendered on 15 November. On 23 November the defence of Manchester was abandoned. The Jacobites reached Derby on 4 December. Derby is over 170 miles south from the Scottish border and less than 40 miles east of Whitmore. More importantly Derby is only 127 miles from London.

From Derby the Jacobites retreated. It was probably not due to Mainwaring’s intervention. Prince Charles and his advisors decided to return to Scotland because of rumours that they were about to face a huge Government army.The Jacobites had good reason to be afraid of an English offensive.

Carlisle was besieged from 21 to 30 December and the Jacobites lost control of the city.

The Jacobites were finally defeatedby the Duke of Cumberland, the son of George II, at the Battle of Culloden on 16 April 1746.

I don’t know if Edward Mainwaring fought against the Jacobites after their retreat from Derby.