Adam on 25 Oct 2012 09:14:01 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] git-fu


Commit your changes then

git reset --hard head~1 

That will set you one commit back. Then

git checkout -b branch_name

Will put you on a new branch

On Oct 25, 2012, at 12:04 PM, "Eric at Lucii.org" <eric@lucii.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> My limited git skills are proving to be insufficient today.
> 
> Background: I made some code changes and committed them.
> I subsequently made more changes but now I'm thinking I
> /may/ have gone down the wrong path.
> 
> I'd like to go back to the last commit, create a branch,
> and try another approach in that branch.  How can I do
> that without losing the current changes in the event I
> want to come back to them?
> 
> Presumably, if the new branch works then I'd merge it into
> master (and then I don't care about what happens to the
> current changes.)
> 
> I suspect tmtowtdi.
> 
> Eric
> - -- 
> #  Eric Lucas
> #
> #                "Oh, I have slipped the surly bond of earth
> #                 And danced the skies on laughter-silvered wings...
> #                                        -- John Gillespie Magee Jr
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
> 
> iEYEARECAAYFAlCJYxgACgkQ2sGpvXQrZ/4U4gCfTYwqK4P1PNNrxBmAnSF1cju4
> f5MAnjAcqr2LCANZIplsO7c0+YXH2c7F
> =7yU1
> -----END PGP SIGNATURE-----
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug