0

My situation: On my branch origin webshop

I need to delete the 2 above commits and revert the whole project back to the 3rd commit.

How do i achieve this? enter image description here

i Tried:

git reset --hard 69697a5

But this keeps the other 2 commits..

alroc
  • 26,843
  • 6
  • 49
  • 94
Rubberduck1337106092
  • 1,164
  • 4
  • 19
  • 36

1 Answers1

2

I wouldn't recommend deleting commits that are already pushed to a remote. This can lead to much confusion for other contributors. Therefore I'd recommend you to revert the commits locally and then push your results: git-revert Documentation.

If you need to truly delete the commits you should first do git reset --hard COMMIT has you have already done. To delete the commits on the remote you need to rewrite it's history aswell using git push --force. You can find further documentation here.