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`. Thank you. Now, how do I get rid of the unwanted merge object? Here's my reflog: keybounceMBP:2aec26bc01189ea4b310 michael$ git reset --hard 38c344c HEAD is now at 38c344c keybounceMBP:2aec26bc01189ea4b310 michael$ git reflog 38c344c HEAD@{0}: reset: moving to 38c344c f2500db HEAD@{1}: merge refs/remotes/origin/master: Merge made by the 'recursive' strategy. 21e7868 HEAD@{2}: checkout: moving from limonite-placer to master 480d7c2 HEAD@{3}: checkout: moving from master to limonite-placer 21e7868 HEAD@{4}: checkout: moving from limonite-placer to master 480d7c2 HEAD@{5}: commit: Adjust swamp and river spawns. e6a4bf5 HEAD@{6}: commit: Should be working children (before testing) 9cb5d06 HEAD@{7}: commit: Syntax errors (I thought I had fixed these before) b4a020f HEAD@{8}: commit: *** CLOUDS don't work right now! 0123eaf HEAD@{9}: commit: 1. Rename everything, to avoid interfering with Geologica, if used. ab78f7a HEAD@{10}: commit: Rename to match Draco's distribution fdedd8a HEAD@{11}: commit: First round of tuning placer deposits. bec1bbb HEAD@{12}: commit: Limonite deposits in wet, or hot biomes, as layers of rich dirt. 21e7868 HEAD@{13}: checkout: moving from master to limonite-placer 21e7868 HEAD@{14}: checkout: moving from 7ed0130d12c4fa3773653b320e2a6e5b0d584702 to master 7ed0130 HEAD@{15}: checkout: moving from master to 7ed0 21e7868 HEAD@{16}: clone: from https://gist.github.com/2aec26bc01189ea4b310.git keybounceMBP:2aec26bc01189ea4b310 michael$ The merge object at f2500db is the problem. That's what I want gone. This repository started with a clone; bec1bbb HEAD@{12} commits a file (or a version of it) that was also entered in directly at github. That's on origin/master. Now that (I think) I have a better idea of what's going on, that commit on origin/master should reflect the 'limonite-placer' branch. (the file is an early version of that file, somewhere around the first two commits on the limonite-placer branch, and is most definitely out of place on master). I don't know how to see the history that happened before that clone; there were several updates on github before that. >> How do I say "save all changes in my working directory to a temporary >> branch"? "git stash", I discovered, does NOT -- at least, not without some >> additional options and I'm not sure what those should be. > > One way to do that : > > ``` > git checkout -b my_temporary_branch > git add . > git commit -m "temporary commit" > git checkout - > ``` Ahh! "git add ." That makes "stash" work. Thank you. -- 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 to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.