When the demons Madhu and Kaitabha stole the Vedas from Brahma, Lord Vishnu took the form of Hayagriva (horse-headed avatar) to defeat them and recover the sacred texts. Hayagriva is worshipped as the god of knowledge and wisdom. Vaman, Kurma, and Varah are other incarnations of Vishnu (dwarf, tortoise, and boar respectively), but not the ones who retrieved the Vedas in this instance.