I’m coming late to the party but I got a little scared after thinking I lost this morning’s work due to an IntelliJ Smart Checkout. So I looked to see if there was a fix and this question came up first.
Sadly, my git stash list was empty (probably because I tried merging the conflicting files) so I couldn’t use the suggestions given in the other answers.
I started looking in the local history (right click in editor > Local History > Show History) of the project root folder to try and get all the missing changes and noticed a change called Uncommitted_changes_before_Checkout_at_27_04_2022_12_06__Changes.xml. As you can see in the screen capture, this file is located in the .idea/shelf folder of your project.
It’s associated with an almost eponymous folder “Uncommitted_changes_before_Update_at_27_04_2022_12_06_[Changes]” and both aren’t deleted anytime soon after the Smart Checkout since I had an other pair dated from 20/04/2022.
The folder contains a shelved.patch file which regroups all your changes in the format shown on the screen capture (I assure you my morning’s work wasn’t just adding a console.log).
This shelved.patch file is used by IntelliJ’s shelf feature, which allows you to see all those changes and reapply them as needed. You can access the shelf from the menu bar (Git > Uncommitted Changes > Show shelf)
IntelliJ shelving all my local changes also happened after an error during an update: Merge Error: unable to write ./git/index.
The project updated properly after the shelving and I could unshelf the changes I wanted.