N
N
NkDev2018-06-09 11:42:07
git
NkDev, 2018-06-09 11:42:07

How to remove a commit in a remote repository?

Made a commit. I didn’t notice how a couple of hundred MBt of shit got into it. Then I pushed and then I found my joint. Tell me how to delete the last commit in a remote repository?
On my local PC, I figured out how to delete: git reset --hard HEAD~1. But now I need to rollback to the remote repository as well! If I just do a push on the remote after this command, will this commit be deleted too?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2018-06-09
@NkDev

Roll back the head locally and force push:
git push -f

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question