1. In a developer’s commit, conflicting files were present, and the code was force-committed without manually resolving the conflicts, as shown in Figure 1.

2. I decided to remove the commits that might contain conflicting files and reset the version to the latest valid commit, as shown in Figure 2.

3. Select Hard Reset to directly discard all changes from subsequent commits, as shown in Figure 3.

4. Reset successful, as shown in Figure 4.

git.exe reset --hard 086fc817cc3d149adf8ebc0489d75b3958ea111f --
HEAD is now at 086fc81 Merge remote-tracking branch 'origin/develop' into develop
Success (593 ms @ 2019/03/18 18:21:37)
5. The local files have been reverted to the latest valid commit, and the conflict prompts have disappeared, as shown in Figure 5.

6. When pushing, a prompt appears indicating that the code must be pulled first. However, pulling the code should not be done at this point; otherwise, the files with conflicts will be pulled down again, as shown in Figure 6.

git.exe push --progress "origin" develop
To https://gitlab.chinamcloud.com/php/pcs-api.git
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to 'https://gitlab.chinamcloud.com/php/pcs-api.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git did not exit cleanly (exit code 1) (2657 ms @ 2019/03/18 18:30:15)
7. Force push the content to the remote server, as shown in Figure 7.

git.exe push --force-with-lease --progress "origin" develop
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for develop, visit:
remote: https://gitlab.chinamcloud.com/php/pcs-api/merge_requests/new?merge_request%5Bsource_branch%5D=develop
remote:
To https://gitlab.chinamcloud.com/php/pcs-api.git
+ b04e465...086fc81 develop -> develop (forced update)
Success (4156 ms @ 2019/03/18 18:51:42)
8. Viewing the commit log on the Git server in Gitlab, I found that the latest commit ID has been reverted to: 086fc817cc3d149adf8ebc0489d75b3958ea111f, as shown in Figure 8.

