如何在 SourceTree 中获取文件到我的本地?

How to get files into my local in SourceTree?

我有一个从远程服务器克隆的本地存储库。大量文件从我的硬盘驱动器中删除,我想从 remore 存储库(位于 BitBucket 服务器上)取回它们。

我是存储库中的唯一用户。我正在做任何工作的唯一分支是 master。

"Pull" 和 "Fetch" 都没有将我的文件从 repote repo 中下载下来。从我的计算机中完全删除存储库然后克隆它似乎有点过分了。

如何让 SourceTree 简单地从远程存储库中获取所有文件并将它们放在我的计算机上?

尝试 switching to command line from SourceTree,然后使用 git checkout 路径:

git checkout master -- .

或者,由于 Git 2.23 和 , as

git restore --source=HEAD --staged --worktree -- .

或者,with git switch(同样,Git 2.23)

git switch -C master origin/master