diff --git a/completers/git_completer/cmd/restore.go b/completers/git_completer/cmd/restore.go index c2138366cb..db92c6ad7e 100644 --- a/completers/git_completer/cmd/restore.go +++ b/completers/git_completer/cmd/restore.go @@ -46,6 +46,10 @@ func init() { if restoreCmd.Flag("staged").Changed { return git.ActionChanges(git.ChangeOpts{Staged: true}).FilterArgs() } + + if f := restoreCmd.Flag("source"); f.Changed { + return git.ActionRefDiffs(f.Value.String()) + } return git.ActionChanges(git.ChangeOpts{Unstaged: true}).FilterArgs() }), )