If you've been using
git push heroku main to deploy your code, you can pull it down using the
heroku git:clone command displayed in the
Deploy section of the dashboard for your app. After pulling down your code, you can follow the instructions to push to your destination of choice.
If you want to take advantage of Heroku's Github integration, you can move your source code to GitHub by pushing your code to a Github repository and linking it with Heroku.