M
M
Michael2015-09-24 14:59:50
git
Michael, 2015-09-24 14:59:50

How to roll back commits if they are already uploaded to github?

All the best!
I rolled back the last 2 commits in git with the following command git reset --hard HEAD~2 I do the git push origin master command and he asks me to do a pull first, but if I do a pull, then those commits that are already there will come back to the local one and it turns out that I will fill in the same. Tell me what should I do?

to tell the truth, I just re-uploaded the repository (all the data is still stored in .git so nothing has changed), but damn, it's primitive like that. maybe there is another way around this pull ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2015-09-24
@id194695811

git push --force origin master

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question