如何在SourceTree中丢弃未提交的更改? [英] How to discard uncommitted changes in SourceTree?

查看:3669
本文介绍了如何在SourceTree中丢弃未提交的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Git环境的新手,我在Mac上使用BitBucket和SourceTree。我现在要做的就是放弃自上次提交以来发生的更改。我应该怎么做?我还没有发现任何类似放弃更改的内容,并且直接从上次提交提取似乎不起作用。使用GUI或命令行完成的解决方案将会很好。谢谢。

解决方案

我喜欢使用

  git存储

这将所有未提交的更改存储在隐藏。如果您想稍后放弃这些更改,只需 git stash drop (或 git stash pop 即可还原它们) p>

虽然这在技术上不是放弃更改的正确方式(正如其他答案和评论所指出的那样)。

I'm new to the Git environment, and I'm using BitBucket with SourceTree on Mac. All I want to do now is to discard the changes since last commit. How should I do this? I haven't found anything like "discard changes", and directly pulling from the last commit doesn't seem to work. Solutions done with either the GUI or command line will be good. Thank you.

解决方案

I like to use

git stash

This stores all uncommitted changes in the stash. If you want to discard these changes later just git stash drop (or git stash pop to restore them).

Though this is technically not the "proper" way to discard changes (as other answers and comments have pointed out).

这篇关于如何在SourceTree中丢弃未提交的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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