How to revert a single committed file that has been pushed in GIT? -


i have done research online, , still not figure out best way revert 1 single file has been pushed repository using git.

i have done git revert, reverts entire commit. let's if have 2, 3 files in commit, want revert 1 file, wouldn't work well.

any ideas? many thanks

first, revert commit, not commit revert: git revert --no-commit <sha>. then, unstage files would reverted git reset. can add files want git add <file>. git commit, clean working directory match index git checkout ..


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -