我可以使用“git checkout - ”吗?在两个文件? [英] Can I use "git checkout --" on two files?

查看:132
本文介绍了我可以使用“git checkout - ”吗?在两个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用git checkout - 在多个文件中放弃更改?如果是这样,我将如何指定多个文件。

解决方案

多次运行命令

git checkout - path / to / file / one
git checkout - path / to / file / two

或者在同一行中指定多个文件:

  git checkout  - 路径/ to / file / one path / to / file / two 

您也可以指定整个文件夹,递归到它们下面的所有文件。

  git checkout  - 路径/到/文件夹
git checkout - 。 #为当前路径


Is it possible to use git checkout -- on multiple files in order to discard the changes? If so how would I specify multiple files. Thanks.

解决方案

Run the command multiple times

git checkout -- path/to/file/one
git checkout -- path/to/file/two

Or specify the multiple files in the same line:

git checkout -- path/to/file/one path/to/file/two

You can also specify entire folders which will recurse to all files below them.

git checkout -- path/to/folder
git checkout -- . # for the current path

这篇关于我可以使用“git checkout - ”吗?在两个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆