Updated: Does not work on Heroku's Cedar stack.
If you want to know which revision has been deployed to Heroku execute the following command in your project:
heroku console "ENV['COMMIT_HASH']"
Credit: http://stackoverflow.com/questions/2281772/view-remote-git-revision-on-heroku/4609925#4609925