On Thu, Feb 26, 2015 at 7:51 AM, Michael <keybou...@gmail.com> wrote:
> On 2015-02-22, at 9:04 PM, Nicolas Dermine <nicolas.derm...@gmail.com> wrote:
>> Hi Michael,
>> On Mon, Feb 23, 2015 at 2:17 AM, Michael <keybou...@gmail.com> wrote:
>>> So a quick question: How do I undo/abort a merge?
>>> I am learning, and experimenting. I was experimenting with "git merge",
>>> forgot the "--no-commit", and discovered the hard way that aborting the
>>> editor that comes up without saving does NOT abort the merge.
>>> And git merge --abort fails, because the merge succeeded.
>>> Git Gui has a way to amend the comment of the last merge, but no way to
>>> undo it.
>>> I figure this should be simple, but I don't know how.
>> One way to do that :
>> - look up the hash of the commit you want to go back to, let's say
>> it's 'abc1234'
>> - run `git reset --hard abc1234`.
> Ok. Now, can you help me fix my remote as well?
> keybounceMBP:2aec26bc01189ea4b310 michael$ git checkout master
> Previous HEAD position was 7ed0130...
> Switched to branch 'master'
> Your branch is up-to-date with 'origin/master'.
> keybounceMBP:2aec26bc01189ea4b310 michael$ git reset HEAD^
> keybounceMBP:2aec26bc01189ea4b310 michael$ git push --all
> Username for 'https://gist.github.com': keybounce
> Password for 'https://keybou...@gist.github.com':
> To https://gist.github.com/5e037df5b5c9209885d5.git
> ! [rejected] master -> master (non-fast-forward)
> error: failed to push some refs to
> hint: Updates were rejected because the tip of your current branch is behind
> hint: its remote counterpart. Integrate the remote changes (e.g.
> hint: 'git pull ...') before pushing again.
> hint: See the 'Note about fast-forwards' in 'git push --help' for details.
> keybounceMBP:2aec26bc01189ea4b310 michael$
You can use (with care) `git push --force` in this case.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.