Git ਤਬਦੀਲੀਆਂ ਨੂੰ ਵਾਪਸ ਕਰਨ ਦੇ ਕਈ ਤਰੀਕੇ ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ ਸਥਿਤੀ ਦੇ ਅਨੁਸਾਰ — ਕਮਿਟ ਨਾ ਕੀਤੀਆਂ ਤਬਦੀਲੀਆਂ ਨੂੰ ਖਾਰਜ ਕਰਨਾ, unstage ਕਰਨਾ, ਆਖਰੀ ਕਮਿਟ ਨੂੰ ਸੋਧਣਾ, ਕਮਿਟ ਨੂੰ ਵਾਪਸ ਕਰਨਾ, ਜਾਂ reset ਕਰਨਾ। ਹਰੇਕ ਸਥਿਤੀ ਲਈ ਸਹੀ ਸੰਦ ਜਾਣਨਾ ਮਹੱਤਵਪੂਰਨ ਹੈ, ਇੱਕ ਮੂਲਵਾਨ ਅਭਿਆਸਕ ਹੁਨਰ ਹੈ।
Uncommitted ਤਬਦੀਲੀਆਂ ਨੂੰ ਵਾਪਸ ਲਓ (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
