Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion packages/dev/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,27 @@ export class GitPlugin extends BasePlugin {
}

async handleResetDo() {
await exec('git checkout .', { slience: false });
console.log('');
console.warn('>> Warning: This will reset all changes in the current branch! <<');
console.warn('>> - New files will be deleted <<');
console.warn('>> - Modified files will be restored <<');
console.warn('>> - Deleted files will be restored <<');
console.warn('>> - Staged files will be reset <<');
console.log('');

await this.needConfirm();

console.log('Resetting branch...');

// Reset staged and modified files
await exec('git reset --hard HEAD', { slience: false });

// Remove untracked files and directories
await exec('git clean -fd', { slience: false });

console.log('');
console.log('>> Branch reset successfully! <<');
console.log('');
}

async handleCheckoutDo() {
Expand Down