jesseduffield / jesseduffield/lazygit

[Feature Request] Discard staged only

Open
#1,782 12 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem? Please describe.**

I am in a situation where I need the staged and keep the unstaged changes unstaged.

We may also need to do this with a single file that is partially staged.

**Describe the solution you'd like**

1. In the reset menu options which opens by pressing D, we should find an option to discard staged changes only.
2. It is reasonable also to have this option for the discard changes for one file menu, which opened by pressing d

**Describe alternatives you've considered**

```
patch -p1 -R < <(git diff --cached) && git reset
```

**Additional context**

![image](https://user-images.githubusercontent.com/42011920/154970409-2bab5820-d2fc-438a-887d-37a925fc7a4e.png)

![image](https://user-images.githubusercontent.com/42011920/154963025-9751c979-92ee-4536-af97-4b4813ae487f.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.