Skip to main content

reset_to_commit

Function reset_to_commit 

Source
pub fn reset_to_commit(workdir: &Path, oid_str: &str, mode: &str) -> Result<()>
Expand description

Reset the current branch to a specific commit.

mode must be one of "soft", "mixed", or "hard":

  • soft — moves HEAD; staged + working-directory changes are kept.
  • mixed — moves HEAD and unstages changes; working directory is kept.
  • hard — moves HEAD and discards all uncommitted changes permanently.