weijia.wang weijia.wang - 1 year ago 128
Git Question

Git reset some changes in a file,in command line

I changed something in a file, and did not use

. Some part of my changes is not necessary, how can I only reset this part. (I know how to revert the whole file, but the file has many changes and only a little change must be reset. Resetting all the changes would be a nightmare)

For some reason I can only use the command line operation git

Answer Source

consider using

git checkout -p

which allows you - for each patch of changes - to reset those changes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download