开发者

Can you undo 'git reset --hard HEAD' if never having made a commit?

I lost some code after running

git reset --hard HEAD开发者_如何学JAVA

and I never committed the work. Is there any way to get this code back? Was it logged anywhere? Can I undo the command?


Nope, git reset --hard and git checkout -f are both destructive of changes that haven't been committed.


Any uncommitted changes in your working directory ( including staged ) will be lost. That is why you should use it cautiously ( or use other flags like --mixed, --soft)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜