Git reset some changes in a file,in command line

I changed something in a file, and did not use add or commit. 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

Answers


consider using

git checkout -p

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


Need Your Help

Getting the first occurence of rows

sql-server tsql

I have a table created by the following t-sql statement:

Errors when using rocketter to deploy to recently upgraded Ubuntu 16.04 box

php ubuntu ssh phpseclib rocketeer

I've recently updated my Ubuntu server from 14.04 to 16.04, but now I'm getting the error show below when I try & deploy using rocketeer, however it seems that the deployment continues and comp...