I'm having a problem trying to revert a file to a previous commit, I know I can use git checkout
to revert a single file but the problem is I have changes in that file I'd like to keep so I was wondering how to do some sort of "merge" between a previous commit and the current HEAD for a single file? I tried using git reset sha-of-my-commit path/to/my/file
but it puts the previous version in the staging area while keeping the latest version on my working directory not sure how to merge both files after it.
What I did for now was just git diff ..sha-of-my-commit path/to/my/file
and just copy/pasted the missing lines but I believe there must be a better way to do this right?