Git push again the same commit to remote

2k views Asked by At

My project has a remote and local synchronized repository.

  1. I did locally new branch -> than committed and pushed to the remote.
  2. Next, I have unaware deleted remote branch - operation is impossible to undo(in Gitlab).

So, locally I have everything OK only my remote repository need to be updated.

How to push again the same commit to remote?

(I do everything in Intellij and one time pushed commit is no more visible there and of course not possible to push again)

Thanks for any help.

1

There are 1 answers

2
Deb On BEST ANSWER

If the remote branch is completely deleted, You can directly push your local branch to remote

git push origin <local-branch-name>

or in Intellij while on your branch press Ctrl+Shift+k and push

Every commit in your local branch should appear in remote