1st battle of Tarain is a prime one.
This isn't exactly diplomacy. But after Mahmud of Ghazni's forces were routed, the Rajputs packed up and went home, not bothering to pursue Mahmud himself. A year later, Mahmud came back and India fell into Muslim rule for the next 7 centuries. But there are...