Reset.default Async

Reset.default(repo, target, pathspecs).then(function(number) {
  // Use number
});

Look up a refs’s commit.

Parameters Type  
repo Repository Repository where to perform the reset operation.
target Commit, Tag The committish which content will be used to reset the content of the index.
pathspecs Strarray List of pathspecs to operate on.
Returns  
Number 0 on success or an error code

Reset.fromAnnotated Async

Reset.fromAnnotated(repo, target, resetType, opts).then(function() {
  // method complete});

Sets the current head to the specified commit oid and optionally resets the index and working tree to match.

This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

See the documentation for reset.

Parameters Type  
repo Repository  
target AnnotatedCommit  
resetType Number  
opts CheckoutOptions  

Reset.reset Async

Reset.reset(repo, target, resetType, opts).then(function(number) {
  // Use number
});

Reset a repository’s current HEAD to the specified target.

Parameters Type  
repo Repository Repository where to perform the reset operation.
target Commit, Tag Committish to which the Head should be moved to. This object must belong to the given repo and can either be a git_commit or a git_tag. When a git_tag is being passed, it should be dereferencable to a git_commit which oid will be used as the target of the branch.
resetType Number Kind of reset operation to perform.
opts CheckoutOptions Checkout options to be used for a HARD reset. The checkout_strategy field will be overridden (based on reset_type). This parameter can be used to propagate notify and progress callbacks.
Returns  
Number 0 on success or an error code

Reset.TYPE ENUM

Flag Value
Reset.TYPE.SOFT 1
Reset.TYPE.MIXED 2
Reset.TYPE.HARD 3