How to revert to a specific commit?
- From
- tao lv <thebookofunknowable@gmail.com>
- Date
- Dec 2, 2024, 11:40 UTC
- Message-ID
- <CAFePT4zytyuLB0TgyJ+mbrNvz=Xt1x+gJv4e-2j07YK7Cg1bzw@mail.gmail.com>
I want to revert the code to a specific commit. This commit is not a direct part of the branch history; there are merge operations, branch forks, and other changes in between. Therefore, directly using `revert HEAD...commit` fails due to merge need -m.
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.
How can I achieve this? Is there a better way than using the revert function?