Modifying incorrect files

I was trying to upload my code, i did my succesful pippeline, but i modified the template file and one of the OTHER’s file by error and i don’t know how to fix it, if i add and commit i don’t pass the precommit, and if i delete them i pass the precommit but my MR is closed because i shouldn’t do that. :cry:
i don’t know if there is a way to restart, without Git bring to me the changes i made

git rebase and git reset are your friends on this kind of situation, check this related post:

1 Like

recently a did both but git ask me for pull my changes because there are diferences between the files that i have when i rebase and when i do that the files that i modified come back

You have a git conflict here, in most cases are simple to solve (if there are not many files on the commit) just open the file with conflicts and choose the versión you want to keep. Usually the git conflicts are caused because there are two different versions of the same file and git can’t decide which one is the valid. If you use a text editor like VScode or Atom the conflicts will become more visual, letting you choose between ours (your local changes) or theirs (the changes made remotely) , if you don’t use any of these editors you’ll see a weird message like this :

<<<<<<< HEAD

in your file, which indicates the beginning and the end of the conflict, get rid of it, and then commit the file again. Once commited you can continue with your rebase process

git rebase --continue

and if everything works fine you have solved the conflict