Restore from main VSCode extension
An very tiny vscode extension that allows users to revert a selected file from main branch. It just does git restore --source=main "${filePath}".
Installation
VS Code
Install from the VS Code Marketplace by searching for "restore-from-main" or use:
code --install-extension smallstack.restore-from-main
VSCodium / open-source builds
VSCodium and other open-source VS Code forks use the Open VSX Registry instead of the Microsoft marketplace. Search for "restore-from-main" in the Extensions view, or install from the CLI:
codium --install-extension smallstack.restore-from-main
You can also download the .vsix from the Open VSX page and install it via Extensions → … → Install from VSIX….
Development & Contributing
- Clone the repository
- Run
npm installto install dependencies - Run
npm run compileto build the extension - Open the folder in VS Code and press
F5to test in debug mode - Make your changes and submit a pull request
Publishing
The extension is published to two registries: the VS Code Marketplace (for VS Code) and the Open VSX Registry (for VSCodium and other open-source builds).
Automated (recommended)
Publishing to both marketplaces runs automatically via the Publish Extension GitHub Actions workflow when you publish a GitHub Release (or trigger it manually from the Actions tab).
One-time repository setup (Settings → Secrets and variables → Actions):
OVSX_PAT— an Open VSX access token. Thesmallstacknamespace must exist on Open VSX and your account must be a member; create it once withnpx ovsx create-namespace smallstack -p <token>.VSCE_PAT— a VS Code Marketplace token (optional; the Marketplace step is skipped if unset).
Manual
- Update the version in
package.json. - Build and package:
npm run package(producesrestore-from-main.vsix). - Publish to the VS Code Marketplace:
npm run publish:vsce(ornpx vsce publish). - Publish to Open VSX / VSCodium:
OVSX_PAT=<token> npm run publish:ovsx.
Both vsce and ovsx are included as dev dependencies, so no global install is required.
