How do I reverse a specific hunk of a commit in git?

git checkout -p $REF -- path/to/file

e.g.,

git checkout -p HEAD^ myfile

Where $REF is a ref name or commit ID that specifies the commit you want to take the file state from. For example, to selectively revert changes made in the last commit, use HEAD^.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)