remove commits and commits history from git and github

First Way

git reset --soft HEAD~1
git push origin YOUR_BRANCH_NAME -f

Second Way

First You need to remove that commit locally.

git rebase -i HEAD~2

and delete the second line within the editor window that pops up.

Then, force push to github by using

git push origin branch_name -f

I am Senior Software Engineer. I love reading, writing, sharing,developing, hiking, movies, trips, mountains, brooks, hills etc.

Tagged with:
Posted in bitbucket, git, github

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: