Al-Harith said that Sayyiduna Ali (may Allah be pleased with him) said: When the pledge is worth more than the loan, or the loan is more than the pledge, and then the pledged item perishes, the two parties return the excess to each other.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الرهن / 11232