Answer the question
In order to leave comments, you need to log in
Git revert
I have two repositories, one bare on the server and the other on my machine.
I want to undo the changes of the last two commits.
I do git reset 6fa93cb0a07c9b9b5dbd03d5dfa861c1fe23afc8 //reset to the revision I need I
do git pull
Naturally they answer me
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:/repositories/repo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (eg 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
If I do a git pull, I will get back those branches that I do not need.
Question: how to roll back changes?
Answer the question
In order to leave comments, you need to log in
git reset 6fa93cb0a07c9b9b5dbd03d5dfa861c1fe23afc8
git push -f origin master
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question