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
Post a Comment