Skip to content

Instantly share code, notes, and snippets.

@chrislerum
Created August 20, 2010 14:35
Show Gist options
  • Save chrislerum/540444 to your computer and use it in GitHub Desktop.
Save chrislerum/540444 to your computer and use it in GitHub Desktop.
usually i don't work on local master branch
this time i did my mistake
got 4 commits ahead of origin/master
to fix, did this:
git checkout working
git checkout master
git reset --hard origin/master
i expected that to do the same thing as git reset --hard head^^^^ (go back 4 commits)
what i got was my new 'working' branch disappeared (why?)
git reflog:
2382623 HEAD@{0}: origin/master: updating HEAD
7bda753 HEAD@{1}: checkout: moving from master to master
7bda753 HEAD@{2}: commit: change issues label
f1c8a6b HEAD@{3}: commit: change tabs to spaces
d453d08 HEAD@{4}: commit: edit feature text
b67f114 HEAD@{5}: commit: updated sample db.yml
how can i get back my lost 4 commits?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment