Can I use “git checkout --” on two files?

前端 未结 6 1069
时光取名叫无心
时光取名叫无心 2020-12-10 10:00

Is it possible to use git checkout -- on multiple files in order to discard the changes?

If so how would I specify multiple files?

6条回答
  •  悲&欢浪女
    2020-12-10 10:41

    Use the following command

       git checkout path/to/fileName path/to/fileName2 path/to/fileName3
    

    This will allow you to revert or discard your changes to the files fileName, fileName2 and fileName3

    Note: that spaces in the path name will cause an issue with git. Use single quotes '' to encase the path name in such cases.

提交回复
热议问题