এটি করার অনেকগুলি উপায় রয়েছে, উদাহরণস্বরূপ:
যদি আপনি আছে না ধাক্কা প্রকাশ্যে এখনো সমর্পণ
git reset HEAD~1 --soft
এটি হ'ল, আপনার প্রতিশ্রুতিবদ্ধ পরিবর্তনগুলি আপনার কার্যনির্বাহী ডিরেক্টরিতে থাকবে, যেখানে সর্বশেষ কমিটগুলি আপনার বর্তমান শাখা থেকে সরানো হবে। দেখুন Git রিসেট মানুষ
যদি আপনি করেনি ধাক্কা প্রকাশ্যে (ক শাখা 'মাস্টার' নামক দিকে):
git checkout -b MyCommit //save your commit in a separate branch just in case (so you don't have to dig it from reflog in case you screw up :) )
প্রত্যাবর্তন স্বাভাবিকভাবে প্রতিশ্রুতিবদ্ধ এবং ধাক্কা
git checkout master
git revert a8172f36 #hash of the commit you want to destroy
# this introduces a new commit (say, it's hash is 86b48ba) which removes changes, introduced in the commit in question (but those changes are still visible in the history)
git push origin master
এখন আপনি যদি আপনার ওয়ার্কিং কপির স্থানীয় পরিবর্তন হিসাবে এই পরিবর্তনগুলি দেখতে চান ("যাতে আপনার স্থানীয় অনুলিপি সেই প্রতিশ্রুতিতে পরিবর্তনগুলি বজায় রাখে") - কেবল --no-commitবিকল্পটি দিয়ে রিভার্ট কমিটকে ফিরিয়ে দিন :
git revert --no-commit 86b48ba (hash of the revert commit).
আমি একটি ছোট উদাহরণ তৈরি করেছি: https://github.com/Isantipov/git-revert/commits/master