It changed all the others to a text file? That doesn't sound right.
Are you sure it didn't just change the icon?
If you opened a material file using "choose default program" and chose notepad, it just makes it have a notepad icon from then on. Like this;
But it should still be a material file.
If not, then just open the file, and then choose Save as...
and click All Files from the dropdown,
and type
.material after the name.