A few days ago I updated one of my key production apps only to discover a serious bug, so I needed to revert it to its previous version which had been replaced a few days before that. In my case, I don’t let Time Machine back up large, relatively static folders like Applications. But if the file isn’t among your backups, or you can’t find it there, so long as there’s a snapshot containing the missing file, it’s just as easy to use that instead.
If you emptied the Trash and the file really has been deleted, your next stop should normally be your backups, for example in the Time Machine app. Unfortunately if it’s an app that you kept in the Dock, you’ll have to manually add it back there, but otherwise it should be back to normal. If you haven’t emptied it yet, the file will still be there and you can use the contextual menu to put it back to where it came from. The first thing you’ll do, of course, is look in your Trash. Thankfully, recent versions of macOS provide several safety nets which spare you from resorting to a third-party tool to undelete files, although there isn’t a simple Undelete menu command anywhere. It’s one of the commonest minor disasters on any computer: you accidentally delete a file you later realise you still needed.