First, paste/create the file resetScript.sh into your IDEA's instalation folder (example: /opt/intellij-idea-ultimate-edition/bin/)
After, edit the file idea.sh that you can locate at the same directory. And add these line before the commented line, # Run the IDE.
sh $IDE_BIN_HOME/resetScript.sh