Regenerate deleted modules .iml files in IntelliJ





Problem: I deleted all the .iml files from my multi module project in order to delete and ignore them from github.

Solution: To re-generate .iml files



1) If you have not invalidated your cache or updated intellij since, locate the folder it used to be in > right click > Local history > show history. from here you should be able to restore that .iml file

2) If the project is gradle based, then click the button "Sync Project with Gradle Files"

3) If the project is maven based, then try re-importing the module


Hope it helps