class Git::Commands::Checkout::Files

Implements the ‘git checkout` command for restoring working tree files

This command replaces files in the working tree with versions from the index (when tree_ish is nil) or a specified tree-ish (commit, branch, tag, etc.).

@example Restore working tree files

files = Git::Commands::Checkout::Files.new(execution_context)
files.call(pathspec: ['lib/foo.rb'])                             # from the index
files.call('HEAD~1', pathspec: ['lib/foo.rb'])                   # from a specific commit
files.call('main', pathspec: %w[lib/foo.rb lib/bar.rb])          # from a branch
files.call(pathspec: ['conflicted.txt'], ours: true)             # resolve conflict (ours)
files.call('main', pathspec_from_file: 'paths.txt')              # paths from a file

@note ‘arguments` block audited against git-scm.com/docs/git-checkout/2.53.0

@see Git::Commands::Checkout

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

@api private