how can I recover a file overwritten in the .app directory inside /Applications on OSX I am using Android Studio and the application is stored in /Application/Android Studio.app.

I'm not sure why, but at some point my keystore file was stored inside this directory, in the bin directory. It is no longer there. I assume that an update occurred, and the entire directory Android Studio.app was wiped. And, the key was deleted. Since this is outside my home folder, I don't believe I have a backup of the keystore file.

Are these files backed up, or put into the trash? Is there a way to recover this file?
If you have Time Machine enabled as a local store option or backing up to an external drive, then that file would be backed up - perhaps several versions and stores. 

The filesystems Apple ships do not have any archive or redo, so you would need to have backed up your application. It's odd that it would store things in the application bundle and not the user home folder. Did you check that perhaps it moved the files to the proper location as part of an update?