From f98d53834de51b9409db6a4ec0baec8a6fa87a8e Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sun, 22 Dec 2024 06:39:39 +0300 Subject: [PATCH] Git: Add gre. --- home/program/bash/module/Git.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/home/program/bash/module/Git.sh b/home/program/bash/module/Git.sh index a9edd2ae..a729cdf2 100644 --- a/home/program/bash/module/Git.sh +++ b/home/program/bash/module/Git.sh @@ -151,6 +151,14 @@ function grs() { git restore --staged "${target}" } +# Restore changes. +# Usage: gre [FILES] +function gre() { + local target=${@} + [[ ${target} == "" ]] && target="." + git restore "${target}" +} + # Run git garbage collection. function ggc() { git gc --aggressive --no-cruft --prune=now