In previous versions of IDEA I was able to set how many days back the Local History feature would keep the changes in the source files. For some reason, I cannot find this i
Modify bin\idea.exe.vmoptions (idea.vmoptions on Linux, Info.plist on Mac), add the following line:
-DlocalHistory.daysToKeep=5
It was the only configurable option removed from the settings user interface.
Another way is to use Help | Find Action, type Registry in the box, ensure that Include non-menu actions option is enabled, select the Registry result from the list, press Enter:

Note that the default value is 5 working days.