method 1 if you have many commits
git rebase -i master
then press keyboard 'i' to edit
you will see like this:
pick etc1
pick etc2
pick etc2
replace the word pick with 'f'
and press esc y :wq
pick etc1 //this commit will the one commit
f etc2
f etc2
and press this command
git push origin +head
method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on
git reset --soft HEAD^1 // or git reset --soft head~1
git commit --amend //then press `:wq`
git push -f
method 3 if you already have one commit and you dont want submit another commit more
git add files...
git commit --amend //then press `:wq`
git push origin +head