git revert - How to undo changes in a file after multiple commits in Git? -


i'm working on branch have changed file in several commits , want revert changes file a's state same initial state had when had first created branch. easiest way achieve this?

git checkout <sha1_of_commit> file/to/restore revert file state after <sha1_of_commit> commit. if want revert state before commit use git checkout <sha1_of_commit>~1 file/to/restore.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -