git - How to rollback changes done by one developer keeping all other changes alive? -
all changes pushed repository, got bug , need roll changes done developerx specific commit(commitx -done before 15 days).
but need preserve changes done other developers after commitx.
option 1 - checkout files of commitx , commit older version of files.
--but there new files added , removed developerx in later commits, happen ? need manually remote/add ?
is there other better way ?
if undesirable changes merged in via pull request (or @ least non-fast-forwarded merge commit), can reference commits hash create new revert commit:
assuming you're on primary branch (likely master
):
git checkout -b revert-bad-changes git revert <hashofmergecommit> # push branch, merge master, whatever process
if changes fast-forwarded or otherwise done right in master branch, you'll need reference numerous commits in revert
command, eg:
git revert <badcommithash1> <badcommithash2> <badcommithash3>...
Comments
Post a Comment