E
E
Evgenij_nechujveter2017-03-13 02:53:22
git
Evgenij_nechujveter, 2017-03-13 02:53:22

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:
d27bcbf48e794769b0edeb8612ccaa4c.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Moseychuk, 2017-03-13
@Evgenij_nechujveter

git push -f

A
aol-nnov, 2017-03-13
@aol-nnov

git revert commit_id; git push
if you ever work in a team, they don’t pat you on the head for force :)

X
xutesayor, 2017-03-13
@xutesayor

How to delete commit history on github server?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question