G
G
Gibbzy2012-04-01 15:56:04
git
Gibbzy, 2012-04-01 15:56:04

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

2 answer(s)
A
Anton Taraev, 2012-04-01
@ataraev

git reset 6fa93cb0a07c9b9b5dbd03d5dfa861c1fe23afc8
git push -f origin master

M
mejedi, 2012-04-01
@mejedi

book.git-scm.com/4_undoing_in_git_-_reset ,_checkout_and_revert.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question