class Git::Commands::Reset

Implements the ‘git reset` command

Resets the current HEAD to a specified state, or updates the staged version of specified files to match the state from a given commit or tree.

@example Reset to HEAD (unstage all changes)

reset = Git::Commands::Reset.new(execution_context)
reset.call

@example Hard reset to a specific commit

reset = Git::Commands::Reset.new(execution_context)
reset.call('HEAD~1', hard: true)

@example Soft reset (preserve staged changes)

reset = Git::Commands::Reset.new(execution_context)
reset.call('HEAD~1', soft: true)

@example Reset specific files to HEAD (unstage)

reset = Git::Commands::Reset.new(execution_context)
reset.call(pathspec: ['file.rb'])

@example Reset specific files to a commit’s version

reset = Git::Commands::Reset.new(execution_context)
reset.call('HEAD~1', pathspec: ['file.rb'])

@note ‘arguments` block audited against

https://git-scm.com/docs/git-reset/2.53.0

@see git-scm.com/docs/git-reset git-reset

@see Git::Commands

@api private