git custom command line

If you can not remember feeling more command, then configure two aliases for git, such as:

--global alias.unstage config git 'the RESET the HEAD -'
git config --global alias.restore 'Checkout -'

we take README.md this file, for example, such as modifying a paragraph description, would like to revert back to the original look:

git restore README.md

execution command to the above,
if the modification has been git add README.md into the holding queue, then the following two commands to be performed sequentially:

git unstage README.md
git restore README.md

 

If you do not configure an alias, then the command would be:

git reset HEAD -- README.md git checkout -- README.md

supplement

git checkout . 



Original link: https: //blog.csdn.net/qq_28867949/article/details/79497583

Guess you like

Origin www.cnblogs.com/marklove/p/11922125.html