Stop Using git checkout
Git 2.23 introduced two commands that replace the two different jobs git checkout used to do: git switch — change or create…
If you’ve accidentally deleted multiple tracked files in your Git repository, you can bring them all back at once using this simple command:
git restore $(git status --porcelain | awk '/^ D/ {print $2}')
All deleted files will be restored to their previous state with a single command.
git status --porcelainawk '/^ D/ {print $2}'D in the status column), and prints just the filenames.git restore $(...)You can use similar patterns to quickly stage or restore other types of changes. For example, to stage all modified files (but not deleted/untracked):
git add $(git status --porcelain | awk '/^ M/ {print $2}')
Or, to restore all modified files (revert changes to tracked files):
git restore $(git status --porcelain | awk '/^ M/ {print $2}')
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com