Re: Help with git - fetch earlier src version

From: parv/FreeBSD <parv.0zero9+freebsd_at_gmail.com>
Date: Wed, 21 Dec 2022 18:33:37 UTC
On Wed, Dec 21, 2022 at 5:09 AM Edward Sanford Sutton, III wrote:

> On 12/21/22 05:56, Per olof Ljungmark wrote:
> > I am facing the same issue as in
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268492
> > or possibly
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267421
> > with a T490 laptop.
> >
> > Can someone please help with the git command to fetch an earlier
> > version, for example the one for the amd64 December 9th. snapshot?
>
>    If you already have a checkout of stable/13, you made no local
> changes, you don't share that repo with anyone, and wanted to roll it
> back to a76fa7bb6cb721bcccc257ddbc4398d25dc8def8 which came 2022-12-08
> 01:18:32 +0000 just before a linuxkpi patch:
>
> git reset --hard a76fa7bb6cb721bcccc257ddbc4398d25dc8def8
>

"reset"? Would "checkout" not work ...

  git checkout a76fa7bb6cb721bcc

... ?

When you want to return to the previous state you can run:
>
> git merge
>


"merge" would add a useless point in the history, as I see no changes
being made or suggested. Why should not use "reset" again as earlier
(to switch to "stable/13")?


And, to switch back to "stable/13", use "checkout" or "switch" ...

  git switch stable/13


- parv



>    I thought --soft should work or excluding that parameter entirely to
> change your tree to that commit and that --hard destroys records of
> future commits from your git tree but that doesn't seem to be the case.
>    You could also create another branch and revert just select commits
> from it so you can otherwise include useful changes (presuming they do
> not also depend on the reverted changes).
>
...