'Android studio strange behaviour : file gets locked unexpectedly

I am experiencing strange behavior with Android Studio for a few days. I am not able to write/open or do anything with some file(in which I am just working) unexpectedly. For that, I have to restart android studio, and then after I am able to edit it.

I want to know if there is any other solution to get my files back in working mode without closing and opening an android studio. My current Android studio version: 4.1.2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source