Git丢弃本地更改

代码示例

17
0

git丢弃本地更改

# Discarding local changes (permanently) to a file:
git checkout -- <file>

# Discard all local changes to all files permanently:
git reset --hard
6
0

撤消未分页的更改git

git checkout -- .
3
0

git重置一个文件

git checkout HEAD -- my-file.txt
2
0

git丢弃未分页的文件

git stash save --keep-index --include-untracked
2
0

git撤消所有更改

git reset --hard
1
0

删除本地更改git

git fetch  # will fetch the latest changes on the remote
git reset --hard origin/master # will set your local branch to match the representation of the remote just pulled down.

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................