-
Notifications
You must be signed in to change notification settings - Fork 889
git reset
vpfau edited this page Oct 24, 2018
·
1 revision
$ git reset
using (var repo = new Repository("path/to/your/repo"))
{
Commit currentCommit = repo.Head.Tip;
repo.Reset(ResetMode.Mixed, currentCommit);
}
$ git reset --soft HEAD^
using (var repo = new Repository("path/to/your/repo"))
{
Commit previousCommit = repo.Head.Commits.ElementAt(1);
repo.Reset(ResetMode.Soft, previousCommit);
}
$ git reset --hard origin/master
using (var repo = new Repository("path/to/your/repo"))
{
Branch originMaster = repo.Branches["origin/master"];
repo.Reset(ResetMode.Hard, originMaster.Tip);
}