Use git revert to revert the commits Step 1: Clone github repository git clone repositoryURL Step 2: Switch branch git checkout -b <branch> --track <remote>/<branch> To view <remote>/<branch> use command: git branch -r Step 3: revert the command git revert HEAD git revert HEAD~3 git revert commit_id Step 4: push to github repository git push origin local_branch git push origin master Find a ref that matches master in the source repository (most likely, it would find refs/heads/master), and update the same ref (e.g. refs/heads/master) in origin repository with it. If master did not exist remotely, it would be created. use git remote -v to view the value of origin