Re: git revert with partial commit.
- From
- Phillip Susi <phill@thesusis.net>
- Date
- Apr 6, 2023, 15:48 UTC
- Message-ID
- <87355ddn6y.fsf@vps.thesusis.net>
- In-Reply-To
- <CAGP6POLVpjxO91s1dX98TLepXMrybSWq9y8qJ6b7w+e0SRJT1A@mail.gmail.com>
Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> Because the commit I want to revert is done a long time ago, which is > not the parent of the commit I'm currently on, so I can't use the `~1` > which indicates that I want to go back one commit from my current > position.
You *can* use HEAD~1. After the git revert, a new commit has been created, and so HEAD~1 refers to the state of things before running git revert.