1

Hi guys I have a master branch that has a broken commit at the tip of the branch. The working version is the commit before that.

How can I make the remote repository have the commit before that (C2) as the commit at the tip and delete the broken commit (C3)?

I am using github if that helps too.

current: C1 - C2 - C3 (tip)

would like to delete C3 (the latest commit).

C1 - C2 (tip)

After I have deleted the latest commit I would like to clear my local git respository and pull the data from my git address again.

I am very confused.

Thanks for the help,

Joe.

jimbob
  • 3,288
  • 11
  • 45
  • 70
  • possible duplicate of [How can I remove a commit on github?](http://stackoverflow.com/questions/448919/how-can-i-remove-a-commit-on-github) – coudy Oct 19 '13 at 17:50

1 Answers1

0

You can

git reset --hard C2

and then git pull. If you prefer, you can 'spell' C2 symbolically by saying HEAD^ or HEAD~1

sehe
  • 374,641
  • 47
  • 450
  • 633