hi Charles,

is this a branch that is local and only visible to you?
if yes i would do the following:

1) delete the fix-up branch:
($ git checkout master)
$ git branch -d fix-up

2) create a new fix-up branch from HEAD on master:
($ git checkout master)
$ git branch fix-up

at this stage both master and fix-up point to the same commit.
fix-up is where it should be, master is "too far". you are sitting
on master (HEAD points to master).

3) rewind master back to where you wanted to be:
$ git reset --hard <hash>

master now points to <hash> whereas fix-up is few commits ahead.

obviously i wouldn't do this if you have already pushed the commits
to some remote master.

good luck!
  radovan



On Thu, 22 Mar 2012 01:54:23 +0100, Charles Manning <mannin...@actrix.gen.nz> wrote:

Hi All

I screwed up by making a working branch but not switching to it.

ie something like

git branch fix-up
edit edit
git commit
edit edit
git commit

Now I have a few commits on master that I really wanted on fix-up and fix-up
is where I wanted master to be.

I think I can fix this by using something like
git reset --soft HEAD^^
git checkout fix-up
git commit ...


But can I fix this by flipping the names around as follows?

git branch -m master tmp
git branch -m fix-up master
git branch -m tmp fix-up

Thanks

Charles

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to