I have a package which I released on NPM and it's currently at version 1.0.1
.
I have made some changes locally, and wanted to publish them.
I entered npm version 1.0.3
and then felt stupid, because I wanted to type npm version 1.0.2
.
How can I restore this mistake?
A colleague just suggested to reset my repository to the remote repository and try again, it worked.
I first used the following commands to reset my repository's master branch (as if it's a clean clone):
git fetch origin
git reset --hard origin/master
Also delete the tags from local and remote
git tag -d 1.0.2
Remove from local repo
git push --delete origin 1.0.2
remove from remote repo
Then I simply added the version:
npm version 1.0.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With