Git reset
git-reset
Undo a dirtied index
####Git
$ git reset
```
#### LibGit2Sharp
```csharp
using (var repo = new Repository("path/to/your/repo"))
{
Commit currentCommit = repo.Head.Tip;
repo.Reset(ResetMode.Mixed, currentCommit);
}
```
### Undo the last commit
####Git
$ git reset --soft HEAD^
#### LibGit2Sharp
```csharp
using (var repo = new Repository("path/to/your/repo"))
{
Commit previousCommit = repo.Head.Commits.ElementAt(1);
repo.Reset(ResetMode.Soft, previousCommit);
}
```
### Permanently undo commits not pushed to remote
####Git
$ git reset --hard origin/master
#### LibGit2Sharp
```csharp
using (var repo = new Repository("path/to/your/repo"))
{
Branch originMaster = repo.Branches["origin/master"];
repo.Reset(ResetMode.Hard, originMaster.Tip);
}

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
