0

I have 3 commits(c1, c2 and c3) to a branch (b).

c3 is a bad commit. As I wanted to revert to c2 so I have undo the git push using following command

cd /path/to/project (branch: b)
git push -f origin c2:b

remotely my branch is reverted to c2, but locally I still have c3. I tried

git pull origin b

Result

nothing to commit, working tree clean

How can I revert to my good_commit (c2) locally ?

Junaid
  • 2,572
  • 6
  • 41
  • 77

1 Answers1

0

You can reset the branch to the commit

git reset --hard c2
Ashish Mathew
  • 783
  • 5
  • 20