Created
December 12, 2025 10:37
-
-
Save floffy-f/a79fd8398db29b324cbc72616da33528 to your computer and use it in GitHub Desktop.
Nushell+git: Unstage a specific set of files according to whether it was added by accident
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gits --porcelain --untracked-files=no | |
| | lines | |
| | each {split column --regex '\s+' | |
| | get 0.column2} | |
| | filter {|x| $x =~ '<PLACEHOLDER put the pattern here>'} | |
| | git restore --staged ...$in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment