IntelliJ IDEs support a wide range of versioning abilities. However, when you write the docs you don't commit each separate change, only major ones, while you make lots of edits and rewriting.
Local history maintains revisions for all meaningful changes, including external ones, and works as an auto-save of changes at different stages of your work.
Imagine, you've written a new section and then decided to check out to another branch and forgot to commit or shelf the changes. Local history will store these changes, and you can get them back.
Right-click anywhere in the editor and choosefrom the context menu.
On the left, there is a list of all saved revisions of the current file with timestamps.
To restore a specific text fragment, select the revision that contains that fragment.
Locate the text fragment you want to restore click the icon to copy it from the left pane.