Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert version of unpublished Node.js package

Tags:

npm

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?

like image 250
Stephan Bijzitter Avatar asked Sep 15 '15 10:09

Stephan Bijzitter


1 Answers

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
like image 199
Stephan Bijzitter Avatar answered Nov 04 '22 00:11

Stephan Bijzitter