The problem is the following: I wanted to push three modified files on the gitlab, but accidentally zakommitil another unnecessary file (as long as everything is local, I haven’t been pushing anything into the remote branch yet). What can I do to remove this extra file from the commit? I did everything through the intellij idea.

1 answer 1

I will not answer about how to do this from intellij idea, and in the console you can solve the problem, for example, like this:

  1. git reset --soft HEAD ~
  2. git reset FILE_KOTORY_NE_DELTED_HEAD_B_COMMIT
  3. git commit -m "commit label"

Read