From: Felipe Contreras Date: Fri, 12 Jun 2009 22:30:38 GMT Subject: Re: EasyGit Integration Message-ID: <94a0d4530906121530m22dbfcb5ye63a0ecb400c4a59@mail.gmail.com> In-Reply-To: <200906130005.20790.jnareb@gmail.com> On Sat, Jun 13, 2009 at 1:05 AM, Jakub Narebski wrote: > On Fri, 12 Jun 2009, Felipe Contreras wrote: >> On Sat, Jun 13, 2009 at 12:21 AM, Jakub Narebski wrote: > >>> Nope. 'git reset' always reset some part of state to a given commit, >>> HEAD by default.  It can reset current branch with --soft, branch plus >>> index with --mixed (default), and branch plus index plus working >>> directory with --hard.  Source is always commit. >> >> You said it: 'git reset --hard' gets something out of the repository >> and into the working directory. >> >> Try this: >> git checkout >> >> Then what is the difference between: >> git checkout HEAD^ >> git reset --hard HEAD^ >> >> In this case they do exactly the same thing, don't they? > > No, they don't.  "git checkout HEAD^" modifies HEAD detaching it. > "git reset --hard HEAD^" modifies branch that HEAD points to (well, > unless HEAD is detached). Read again: >> git checkout The HEAD is detached, so they do exactly the same in this case. -- Felipe Contreras