1

I'm trying to delete my last push with VSCode. I tried using "Undo last commit" and "Discard all changes'.

When I do that my last commit gets deleted on my computer but I cannot push it again because it says that there are no changes.

Do you have any suggestions to solve that issue? Thank you.

batatop
  • 979
  • 2
  • 14
  • 31

1 Answers1

8

VS code does not have this option from the UI yet. There's a PR that is about to be merged that will bring this feature soon.

Meanwhile, after you have undo-ed last commit and discarded the changes you wont be able to push to remote normally. This is because the tip of your local branch HEAD is behind the remote one. Use force push from the terminal as of now.

git push origin <branch-name> --force-with-lease

Ref #1: https://github.com/Microsoft/vscode/pull/53286

Ref #2: https://stackoverflow.com/a/37460330/3824876

vishnu narayanan
  • 3,813
  • 2
  • 24
  • 28