Answer the question
In order to leave comments, you need to log in
What command to prescribe to remove the last commit on github?
In general, the situation is this:
I created a file, committed it and sent it to Github, Now I changed my mind and I don’t want this file to be there (need to be deleted) how can I do it using Git? After all, when I write the command "Git reset --hard here is the number of the previous commit" nothing happens.
I used the git reset --hard HEAD~1 command, but it only cleaned me up locally, it doesn’t let me push:
Answer the question
In order to leave comments, you need to log in
git revert commit_id; git push
if you ever work in a team, they don’t pat you on the head for force :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question