I've been searching the JGit API for hours, trying to figure out how to reach a similar behavior to git checkout -m file
.
What I need is a programmatic way to revert the local repository (or a single file) to the state it was when it had conflicts.
Imagine the following scenario:
- I have a conflict in 'file1' when trying to merge two branches.
- I start making changes to 'file1' to solve the conflicts.
- At some point, I want to discard the changes made on 'file1' and go back to the conflict state, with all conflict 'marks'.
Is it possible to achieve this using JGit API?