Git మార్పులను రద్దు చేయడానికి పరిస్థితిపై ఆధారపడి అనేక మార్గాలను అందిస్తుంది — కమిట్ చేయని మార్పులను విస్మరించడం, unstaging, చివరి కమిట్ను సవరణ చేయడం, కమిట్ను రిভర్ట్ చేయడం, లేదా రీసెట్ చేయడం. ప్రతి పరిస్థితికి సరైన సాధనం తెలుసుకోవడం ముఖ్యమైనది, విలువైన ఆచరణాత్మక నైపుణ్యం.
Undo uncommitted changes (working directory)
git restore <file> # discard unstaged changes to a file (revert to last commit)
git checkout -- <file> # older equivalent
git restore . # discard ALL unstaged changes (careful!)
git clean -fd
