title: An edit to .master file broke my SharePoint Site, where can I look to restore the site?
body: <p>I was trying to install Google Analytics in my site and I made quite the lazy move. Since I wanted the code to be inserted into the header of my site, I went to one of my files in the root of my site called root.master. This is the .master file that is referenced in all my site pages.</p>
  
  <p>I simply copied and pasted the Analytics tracking code into that root.master file. The site is now broken! I tried deleting the code I put in. I also created a back up of the file before I did any work in it. I tried restoring that file from the backup. I also tried to reset the file to the site definition. No luck.</p>
  
  <p>I'm not sure what the issue is or where to start! All I did was add the analytics code, nothing else. Can someone help me get this site live again?</p>
  
  <p>The error message that displays is:</p>
  
  <p>Sorry, something went wrong
  The base type 'Microsoft.SharePoint.Spx.WebsiteCore.RootMaster' is not allowed for this page. The type Microsoft.SharePoint.Spx.WebsiteCore.RootMaster, Microsoft.SharePoint.Spx.WebSiteCore, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c could not be found or it is not registered as safe.</p>
  
  <p>Here is the root.master file that I edited:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint" %&gt;
  &lt;%@ Import Namespace="Microsoft.SharePoint.Spx.WebSite.Controls" %&gt;
  &lt;%@ Import namespace="Microsoft.SharePoint.Spx.WebsiteCore" %&gt;
  &lt;%@ Import namespace="Microsoft.SharePoint.Spx.WebsiteCore.Controls" %&gt;
  &lt;%@ Master Language="C#" Inherits="Microsoft.SharePoint.Spx.WebsiteCore.RootMaster"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  
  &lt;html dir="&lt;%=Loc.ContentDirection %&gt;" xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
   &lt;%=TitleAndMetaHtml %&gt;
   &lt;%-- The part of CSS that does not change for different themes --%&gt;
   &lt;Shared:ResourceIncludeControl runat="server" FileName="/_layouts/15/#LCID#/wh/stylesV2/masterroot.css" IsLocalized="false" ResourceType="CSS" /&gt;
  
   &lt;%-- Required for table support --%&gt;
   &lt;Shared:ResourceIncludeControl runat="server" FileName="/_layouts/15/#LCID#/wh/stylesV2/tables.css" IsLocalized="false" ResourceType="CSS" /&gt;
   &lt;Shared:ResourceIncludeControl runat="server" FileName="_layouts/15/#LCID#/wh/stylesV2/spxpubc2.css" IsLocalized="false" ResourceType="CSS" /&gt;
  
   &lt;%-- Accessibility --%&gt;
   &lt;Shared:ResourceIncludeControl runat="server" FileName="/_layouts/15/#LCID#/wh/stylesV2/accessibility.css" IsLocalized="false" ResourceType="CSS" /&gt;
   
   &lt;%-- Theme-specific CSS --%&gt;
   &lt;% if (isByosActivated) { %&gt;
   &lt;link type="text/css" rel="stylesheet" href="&lt;%=ServerRelativeUrl%&gt;/_protected/theme.css" /&gt;
   &lt;% } else { %&gt;
   &lt;link type="text/css" rel="stylesheet" href="&lt;%=ServerRelativeUrl%&gt;/&lt;%=FileManager.ResourceFolderValue%&gt;/theme.css" /&gt;
   &lt;%} %&gt;
   &lt;% if( customCssEnabled){ %&gt;
   &lt;link type="text/css" rel="stylesheet" href="&lt;%=ServerRelativeUrl%&gt;/&lt;%=FileManager.ResourceFolderValue%&gt;/custom.css?lm=&lt;%=customCssModifiedDate %&gt;" /&gt;
   &lt;%} %&gt;
   &lt;%=GetStyleHtml()%&gt;
  
  &lt;/head&gt;
  &lt;body class="&lt;%=Loc.ContentDirection %&gt;"&gt;
  
  &lt;form id="IWS_WH_Elem_Form" runat="server"&gt;
   &lt;div class="s4-notdlg"&gt;
    &lt;a href="javascript:;" onclick="javascript:this.href='#mainContent';" class="ms-SkiptoMainContent" accesskey="&lt;%$Resources:wss,maincontent_accesskey%&gt;" runat="server"&gt;&lt;SharePoint:EncodedLiteral runat="server" text="&lt;%$Resources:wss,mainContentLink%&gt;" EncodeMethod="HtmlEncode"/&gt;&lt;/a&gt;
   &lt;/div&gt;
  
   &lt;table cellspacing="0" class="MS_MasterFrame" cellpadding="0" border="0"&gt;
    &lt;tr&gt;
     &lt;td id="IWS_WH_Elem_GlobalLinks" class="MS_MasterGlobalLinks"&gt;
      &lt;%=GetGlobalLinksHtml()%&gt;
     &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr &gt;
     &lt;td id="IWS_WH_Elem_Header" class="MS_MasterHeader"&gt;
      &lt;%=GetHeaderHtml()%&gt;
     &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style="&lt;%=GetTopNavStyle()%&gt;"&gt;
     &lt;td id="IWS_WH_Elem_TopNav" class="MS_MasterPrimaryNav"&gt;
      &lt;%=GetTopNavHtml()%&gt;
     &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt; 
     &lt;td&gt;
     &lt;table cellspacing="0" cellpadding="0" border="0" style="width:100%"&gt; &lt;tr&gt;
      &lt;td id="IWS_WH_Elem_LeftNav" nowrap="true" class="MS_MasterLeftNav" style="width:&lt;%=GetLeftNavWidth()%&gt;" &gt;
       &lt;%=GetLeftNavHtml()%&gt;
      &lt;/td&gt;
      &lt;td class="MS_MasterBody"&gt;
       &lt;a name="mainContent"&gt;&lt;/a&gt;
       &lt;div id="IWS_WH_Elem_Content" class="MSC_Body"&gt;
        &lt;asp:ContentPlaceHolder ID="IWS_WH_CPH_Content" runat="server"&gt;
        &lt;/asp:ContentPlaceHolder&gt;
       &lt;/div&gt;
      &lt;/td&gt;
     &lt;/tr&gt;&lt;/table&gt;
     &lt;/td&gt;
    &lt;/tr&gt;
  &lt;% if (footerEnabled)   { %&gt;  
    &lt;tr&gt;
     &lt;td id="IWS_WH_Elem_Footer" colspan="2" class="MS_MasterFooter"&gt;
      &lt;div class="MSC_FooterFrame"&gt;
       &lt;span id="IWS_WH_Elem_FooterLinks"&gt;
        &lt;%=GetFooterLinksHtml()%&gt;
       &lt;/span&gt;
       &lt;div id="IWS_WH_Elem_FooterText" class="MSC_FooterText"&gt;
        &lt;%=GetFooterText()%&gt;
       &lt;/div&gt;
      &lt;/div&gt;
     &lt;/td&gt;
    &lt;/tr&gt;
  &lt;%} %&gt;
   &lt;/table&gt;
  &lt;/form&gt;
  
  &lt;%=RootMaster.GetFCProScript()%&gt;
  &lt;!-- CXNID=5426436&amp;Code=C2 --&gt; 
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any help is much appreciated!</p>