Suppose the default.aspx page of a a site has been customized (unghosted) and needs to be reset. Following code shows how this can be done using SPFile.RevertContentStream()
using (SPSite site = new SPSite("http://aissp2013/sites/Team/"))
{
using(SPWeb web in site.RootWeb)
{
SPFile file = web.GetFile(web.Url + "/default.aspx");
if (file.Exists)
{
file.RevertContentStream();
}
}
}