M
M
muhasa2019-11-19 12:09:17
git
muhasa, 2019-11-19 12:09:17

How to delete the last commit locally in GIT and then apply the changes to the server with the correct HEAD transfer?

Hello. I'm learning git, it's still a puzzle.
Question. I have a master branch, branched off feature-1 from it, made changes there, merged it with master, uploaded the changes to the server. I realized that the changes on the server were not as enthusiastic as they were on the local one, so I decided to push the last commit (even if through git reset --hard HEAD~1) locally, then pushed the changes like this (git push --hard origin master) . The remote repository no longer sees the merge between master and feature-1, which is what was required.
BUT! When pulling to the git pull origin master server, the head of the branch (head) is still on the old commit. Logically, she should not know at all and see merges with feature-1 in the master branch.
What am I doing wrong?..
Thank you!
PS I searched on stackoverflow, there is a lot of English text, I didn’t understand shit.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question