title: Which is Jest way for restoring mocked function
body: <p>In Sinon's stub it is very easy to restore functionality.</p>
  
  <pre><code>const stub = sinon.stub(fs,"writeFile",()=&gt;{})
  ...
  fs.writeFile.restore()
  </code></pre>
  
  <p>I am looking to do the same thing with Jest. The closest I get is this ugly code:</p>
  
  <pre><code>const fsWriteFileHolder = fs.writeFile
  fs.writeFile = jest.fn()
  ...
  fs.writeFile = fsWriteFileHolder 
  </code></pre>