恢复此空白更改

问题描述 投票:0回答:1

我似乎在 Git 中更改了空格,但无法恢复它。我复制了左侧的内容并将其粘贴到 VS Code 中的代码中,但它没有检测到任何更改。如何恢复这个特定文件?我不想恢复我的整个提交。请看下图。 enter image description here

git diff whitespace
1个回答
0
投票

通过交互式变基很容易做到这一点:

# Assuming no modified files
git rebase --interactive --rebase-merges $COMMIT_ID_TO_PARENT_OF_THE_PROBLEMATIC_COMMIT
...
# Change "pick" to "edit" in todo-list and exit editor
...
dos2unix your/file/with/wrong/eol.json              # or unix2dos if applicable
git add your/file/with/wrong/eol.json
git rebase --continue

如果发生冲突,使用 KDiff3 解决

© www.soinside.com 2019 - 2024. All rights reserved.