I want to check whether Revert commits a conflict, whether it is necessary to commit changes, or it is not necessary

  • Try it. What is the question then? - edem
  • The question is whether the data related to the commit is deleted from the indexes and working directory. That is, make git revert commit, then make git add file and git commit -m "new", return everything to its original state - polin11
  • revert is simple: put a reverse patch (equivalent to changing the editor with pens) and commit these files. The reverse patch is obtained from a defaulted commit that is rolled back; the pros and cons are simply changing. - KoVadim

1 answer 1

If there are changes in the working copy or in the index that affect any of the files that have changed and in the reversed commit, the revert command will return an error:

 error: Your local changes to the following files would be overwritten by merge: файл1 файл2 Please commit your changes or stash them before you merge. Aborting fatal: revert failed 

therefore: yes, it is necessary to pre-commit ( commit ) or postpone ( stash ) changes in those files that have been changed in the reversed commit.