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