Re: How to revert to a specific commit?
- From
Matěj Cepl <mcepl@cepl.eu>
- Date
- Dec 2, 2024, 12:50 UTC
- Message-ID
- <D6187MXMNNS6.11QZW2TCWKKNW@cepl.eu>
- In-Reply-To
- <CAFePT4zytyuLB0TgyJ+mbrNvz=Xt1x+gJv4e-2j07YK7Cg1bzw@mail.gmail.com>
On Mon Dec 2, 2024 at 12:40 PM CET, tao lv wrote:
> I don't want to revert each individual commit; I just want to restore > the code to this specific commit while retaining all the current > history commits.
Either git checkout <commit-id> for an inspection or git reset --hard <commit-id> for change of the current branch to that commit.
Matěj
--
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
Books aren’t written - they’re rewritten. Including your own. It
is one of the hardest things to accept, especially after the
seventh rewrite hasn’t quite done it.
-- Michael Crichton, alluding to Steele MacKaye (1889) article
where he said this about theater plays.