His father, a captain with the 3rd Bengal Cavalry, was murdered in Kabul during the First Anglo-Afghan War, at the time of the assassination of the British Envoy, Sir William Macnaghten.
Educated at Edinburgh Academy and Addiscombe Military Seminary, Trevor was commissioned second lieutenant in the Bengal Engineers in December 1849.
Major-General Tombs, C.B., V.C., the Officer in command at the time, reports that a party of the enemy, from 180 to 200 in number, had barricaded themselves in the Block-house in question, which they continued to defend after the rest of the position had been carried, and the main body was in retreat.
Seeing no Officer of the storming party near him, and being anxious that the place should be taken immediately, as any protracted resistance might have caused the main body of the Bhooteas to rally, the British force having been fighting in a broiling sun on very steep and difficult ground for upwards of three hours, the General in command ordered these two Officers to show the way into the Block-house.
Major-General Tombs states that on speaking to the Sikh soldiers around him, and telling them in Hindoostani to swarm up the wall, none of them responded to the call, until these two Officers had shown them the way, when they followed with the greatest alacrity.