Thuta Learning
ရှာဖွေရန်
AdvancedDevOps & Toolsbeginner

Undoing Changes (reset)

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

git reset command ကို project history ကို ပြင်ဆင်ရန် အသုံးပြုသည်။ ဥပမာ၊ နောက်ဆုံး commit ကို undo လုပ်ရန်။ ၎င်းသည် history ကို ပြန်လည်ရေးသားသောကြောင့် public (pushed) commits များကို reset လုပ်ရာတွင် သတိထားရမည်။

bash
# Resets the staging area and working directory to the last commit
# --hard flag is destructive and will delete your uncommitted changes!
git reset --hard HEAD

# Moves HEAD back one commit, keeping the changes in the working directory
git reset HEAD~1
You should see
(Commit history ကို ပြန်လည်ပြင်ဆင်နိုင်သော်လည်း သတိဖြင့်သုံးရမည့် powerful command ဖြစ်သည်)
Undoing Changes (reset) | Thuta Learning