There are a lot of git and github docs and guides out there, I suggest you start at http://help.github.com/ As for your issue, if you committed the changes, they are not lost. Git is actually very stubborn about removing objects, so long as they exist. Commit often, that way you don't risk losing uncommitted changes, and you can always amend or rebase commits before you push them so that they are a bit less train-of-thought.
You can use the reflog for your branch (the history of each commit the branch has pointed to), or if that fails, git-lost-found: http://www.kernel.org/pub/software/scm/git/docs/git-lost-found.html Walking the ref log is fairly easy. First I would launch gitk so you can visualize where your branches are. Then simply create a branch, reset it to the last ref from your devbranch's reflog, check that in gitk, and repeat till you find the commit you want. Make sure you don't have any uncommitted changes before you begin! cd your_repo gitk --all& git branch temp devbranch git checkout temp git reset --hard devbra...@{1} # refresh and check gitk git reset --hard devbra...@{2} # refresh and check gitk ... I would also recommend you use gitk (or gitx on OSX) in the future when you're resetting branches, so that you're sure you reset to the commit you want. Tekkub Github Tech Support http://support.github.com/ Join us on IRC: #github on freenode.net Discussion group: [email protected] On Tue, Aug 11, 2009 at 10:44 AM, gberz3 <[email protected]> wrote: > > Hi All, > > Doing my best to not go ballistic here. =P Ok, I followed the > (admittedly conflicting) instruction on reverting changes in a git > repository. I used the following: > > git reset --hard HEAD^ > > Basically, I have two branches: "master" and "devbranch". I was about > 4 commits up on "devbranch" when I decided that I didn't want my > existing changes since the most recent commit. In an effort to go > back to the most recent commit on "devbranch" I performed the previous > command. Well, it took me back to the last commit that matched up > with "master". Needless to say, I lost a *TON* of work. > > I'll be the first to admit that I'm no source-control guru, but items > like this should be documented (and probably implemented) in more > straightforward, intuitive terminology. Can someone direct me (at > least for the time being) to the "simpleton" version of GIT > documentation? > > Best. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GitHub" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/github?hl=en -~----------~----~----~----~------~----~------~--~---
