title: NPM: revert installed packages
body: <p>I'm working in a Node.js application with <strong>npm</strong> and <strong>git</strong>. When I add new npm packages I use <code>npm &lt;package&gt; --save</code> and it is saved on '<em>package.json</em>' file.</p>
  
  <p>The thing is that when I use <code>git reset --hard</code>, the '<em>package.json</em>' file is reverted, but the packages are still installed.</p>
  
  <p>The question is: how can I uninstall automatically npm packages that I have installed before the <code>git reset --hard</code>?</p>