I need a git alias to stash then reset.
Which one should I use in my .bashrc:
git config --global alias.sr '!git stash && git reset --hard HEAD'
or,
git config --global alias.sr 'git stash && git reset --hard HEAD'
I am asking this because How can I stage and commit all files, including newly added files, using a single command? used !git
and I am not sure what that actually means amd it confused me to use one or the other.