There is an unnecessary commit on the server at the moment, it needs to be removed from the server.

I did:

git reset --hard HEAD~1 

Locally, the changes rolled back. But now when push server, the changes are there. Tried to do Rebase but that didn't help either.

How to push so that the last commit was deleted?

Reported as a duplicate by participants Duck Learns to Hide , Kromster , Pavel Mayorov , user207618, Grundy Oct 20 '16 at 9:31 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Well, your last question is closed as a duplicate, not just the same. There is a link where it was already asked and answered in detail. Maybe you forgot the flag -f for example - Duck Learns to Take Cover

1 answer 1

The problem was solved by the following command:

 git log //ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅Ρ‚ список всСх ΠΊΠΎΠΌΠΌΠΈΡ‚ΠΎΠ² Π² Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Π±Ρ€Π°Π½Ρ‡Π΅ ΠΈ ΠΈΡ… id git revert <id> //отмСняСт измСнСния Π²Ρ‹Π±Ρ€Π°Π½Π½ΠΎΠ³ΠΎ ΠΊΠΎΠΌΠΌΠΈΡ‚Π° локально. 

further commit , push .

  • yeah That is, the problem was not "how to rollback the commit"? and "how do I identify a commit I want to roll back"? Plus, I’m curious, are you reading the answers to your questions, or are you just asking for the love of art? Yesterday you asked almost the same thing, and the answer was received as a result and applied. - Duck Learns to Take Cover
  • When reset --hard HEAD ~ 1 did not help, because the server automatically merges the changes that already exist in it, and this cannot be changed (probably :)). After that I began to look towards revert. - JAVAvladuxa