4

完成此任务的最佳实践是什么:

我有提交:

A -- B -- C

提交 B 包括:

file1.java
file2.java
icon.png

我想撤消对 的更改file1file2但不想撤消对icon.png.

4

1 回答 1

3

您可以暂存提交 B 的还原,然后在提交之前重置映像文件。

# Prepare a revert of B
git revert -n B

# Recover the current version of the image
git checkout HEAD -- icon.png

# Commit the "almost" reversion of B
git commit
于 2012-05-24T06:56:55.310 回答