跳到正文
W Winse Blog
linux 1 min read

记git reset --hard

平时不是所有的改动都提交,也保留一些临时代码。今天在主干上提交了后,需要reset后退到前几天的版本,但是直接checkout是新建一个分支,如果reset sort还需要处理index,麻烦,就在eclipse中点击了reset hard,我勒个去,直接把 原来提交过的代码 改动没提交的 给还原了!!!

https://stackoverflow.com/questions/9529078/how-do-i-use-git-reset-hard-head-to-revert-to-a-previous-commit

First, it’s always worth noting that git reset --hard is a potentially dangerous command, since it throws away all your uncommitted changes. For safety, you should always check that the output of git status is clean (that is, empty) before using it.

–END

在 GitHub 上讨论

欢迎通过 GitHub Issue 留言或反馈。每条讨论都会关联到对应文章的源文件路径。

src/posts/2023-02-01-git-reset-hard.md

Related posts