Git revert old commit

I want to remove my 4th commit from last.

 Command  Info
 git log -6  to check last 6 commits
git rebase -i HEAD~4  to rebase last 4 commits
i i to select row

remove the entire line of commit to be deleted

click esc

:

wq

to Save

: to enter text in cmd

w to write and q to escape

git push –force origin master to push the revert
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s