title: Target/Classes accidentally removed from Java Maven Project in IntelliJ
body: <p>My Maven project was working fine in IntelliJ. I was writing "How to run the project" in README so I tried to open the project in Eclipse. When I opened it in Eclipse, it did not show src/main/java even though the folder exists. I then removed the project from Eclipse work space (not from the disk). </p>
  
  <p>Now, when I ran the code in IntelliJ again, my <code>Main.class</code> and other classes were deleted from <code>target/classes</code>, thus producing this error</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassNotFoundException: Main
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:264)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
  </code></pre>
  
  <p>My project tree:</p>
  
  <pre><code>Project
      .idea
      src
          main
              java
              resources
          test
      target
          classes (This is where all classes were removed)
      ...
  </code></pre>
  
  <p>I have tried to undo my last <code>git add</code> with <code>git reset -- target</code>. Of course the error is still there.</p>
  
  <p>How do I restore my <code>target/classes</code>?</p>