As you have seen, Heroku does provide a way to clone or pull code for Git-based deployments¹. This won't help you with your Docker deployment, though.
I've never done this, but try logging into the Heroku Docker registry directly with Docker:
docker login --username=_ --password=$(heroku auth:token) registry.heroku.com
And then see if you can pull your container:
docker pull registry.heroku.com/<app>/<process-type>
If supported, this should pull your container down from Heroku to your local machine. But this isn't going to give you your source directory back.
If you are working in an interpreted language, you could try running the container and then copying your source code out of it using docker cp
. If you're working in a compiled language, unfortunately all you're likely to be able to retrieve is your compiled assets.
I learned my lesson of pushing code regularly
I'm glad to hear this. It can be a painful lesson; hopefully you are able to get back what you need from the container registry.
¹You already know this, but for others in the future: this is not meant to be used regularly:
A Heroku app's Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature and should be attempted only as a last resort. Do not use this repository as your app's canonical "origin" repository. Instead, use your own Git server or a version control service such as GitHub.