I was playing around with heroku and django .To host my django app on heroku ,I had to change many files(settings,urls,requirements.txt etc) so many times back and forth (so as to get things right) .As a result there are so many commits in the repo.Problem is that I have the stable version of the code(before the heroku specific modifications were done) on github and now it would look ugly if I push to my github all those commits which I did to get app working on heroku .
So,I want to remove all those commits,and get back to the older stable version.Then I can add the heroku specific modifications and just do one commit.The way I  see it ,I can do
1.pull from github and then add heroku specific changes.Then commit,push to github,push to heroku.
2.In gitk ,I can select the last pre-heroku commit, right click and do 'Reset master branch to here'.Then make heroku related changes,commit ,push to github,push to heroku.
Which is the correct way to do this?Suppose the pre-heroku commit was ver6, and my current commit is ver10,there are 4 unnecessary commits which I made.I need to wipe them clean ,and make the next commit ver7.
Can someone please advise?
 
     
    