I am new to libgit sharp library. I have a line of code that works with v0.15 of libgit sharp. I have updated the package to the latest version 0.22. Repository.Network.FetchHeads.FirstOrDefault()
FetchHeads is deprecated in v0.17 (https://github.com/libgit2/libgit2sharp/blob/master/CHANGES.md).
Here is the snippet that I want to rewrite
var latestRemoteHead = repo.Network.FetchHeads.FirstOrDefault();
if (latestRemoteHead != null){
var latestRemoteHeadCommit = (Commit)latestRemoteHead.Target;
repo.Reset(ResetMode.Hard, latestRemoteHeadCommit);
}