diff --git a/lua/fzf-lua/actions.lua b/lua/fzf-lua/actions.lua index c3461a1..aaf9241 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -498,6 +498,11 @@ M.git_unstage = function(selected, opts) git_exec(selected, opts, cmd) end +M.git_reset = function(selected, opts) + local cmd = path.git_cwd({"git", "checkout", "HEAD", "--"}, opts) + git_exec(selected, opts, cmd) +end + M.git_buf_edit = function(selected, opts) local cmd = path.git_cwd({"git", "show"}, opts) local git_root = path.git_root(opts, true) diff --git a/lua/fzf-lua/config.lua b/lua/fzf-lua/config.lua index 37f8b2a..ee2ecdd 100644 --- a/lua/fzf-lua/config.lua +++ b/lua/fzf-lua/config.lua @@ -866,6 +866,7 @@ M._action_to_helpstr = { [actions.git_checkout] = "git-checkout", [actions.git_stage] = "git-stage", [actions.git_unstage] = "git-unstage", + [actions.git_reset] = "git-reset", [actions.git_buf_edit] = "git-buffer-edit", [actions.git_buf_tabedit] = "git-buffer-tabedit", [actions.git_buf_split] = "git-buffer-split",