git reset HEAD使用

简介:

修改demo1.txt文件

vim demo1.txt

修改hello.php

vim hello.php

查看文件状态

git status -s

添加到缓存区

git add .

查看文件状态

git status -s

将hello.php从缓存区清除

git reset HEAD -- hello.php

查看文件状态

git status -s

提交文件

git commit -m '修改demo1'

查看文件状态

git status -s

命令行输出

wKioL1jKA7ezuV_JAAD0E7XLzOM910.png-wh_50



本文转自 素颜猪 51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/1907146

相关文章
|
编译器 开发工具 git
【Git异常】You are in ‘detached HEAD‘ state, which means that you‘re not on any branch Checkout a branch
【Git异常】You are in ‘detached HEAD‘ state, which means that you‘re not on any branch Checkout a branch
780 0
|
开发工具 git
成功解决git rebase问题:First, rewinding head to replay your work on top of it...
成功解决git rebase问题:First, rewinding head to replay your work on top of it...
|
网络安全 开发工具 git
git 出现错误:kex_exchange_identification: read: Connection reset by peer fatal
git 出现错误:kex_exchange_identification: read: Connection reset by peer fatal
git 出现错误:kex_exchange_identification: read: Connection reset by peer fatal
|
存储 JavaScript 前端开发
细读 Git | 让你弄懂 origin、HEAD、FETCH_HEAD 相关内容
细读 Git | 让你弄懂 origin、HEAD、FETCH_HEAD 相关内容
5563 2
细读 Git | 让你弄懂 origin、HEAD、FETCH_HEAD 相关内容
|
开发工具 git
7-5git reset --hard origin/master代表什么意思
7-5git reset --hard origin/master代表什么意思
|
开发工具 git
idea的git reset current branch to here操作详解
idea的git reset current branch to here操作详解
1895 1
|
开发工具 git
Git恢复之前版本的两种方法reset、revert(图文详解)
Git恢复之前版本的两种方法reset、revert(图文详解)
1381 0
|
存储 开发工具 git
(详解踩坑)GIT版本回滚git stash、git reset、git reset --hard、git revert
(详解踩坑)GIT版本回滚git stash、git reset、git reset --hard、git revert
2286 0
|
开发工具 git
【Git】push代码时候报错,出现fatal: unable to access xxx Recv failure: Connection was reset
【Git】push代码时候报错,出现fatal: unable to access xxx Recv failure: Connection was reset
698 0
|
jenkins 持续交付 开发工具
jenkins无法连接仓库:Command “/usr/bin/git ls-remote -h -- https://gitee.com/xxx.git HEAD“ returned
jenkins无法连接仓库:Command “/usr/bin/git ls-remote -h -- https://gitee.com/xxx.git HEAD“ returned
1585 1
jenkins无法连接仓库:Command “/usr/bin/git ls-remote -h -- https://gitee.com/xxx.git HEAD“ returned